Retrieve the User Id of the signed in user

Use this board to ask questions or have discussions with other Atrium users.
JamesMayor
New User
Posts: 13
Joined: Wed Oct 07, 2009 12:12 pm
First Name: James
Last Name: Mayor
Company Name: Gazelle Book Services Ltd
Phone: 01524 528521
Address 1: White Cross Mills
Address 2: Hightown
City: Lancaster
State / Province: Outside Canada/USA
Zip / Postal Code: LA1 4XS
Country: United Kingdom
Contact:

Retrieve the User Id of the signed in user

Post by JamesMayor »

I need to retrieve the User Id of the signed in user into a RPGSP program, does Atrium store these values and if so how would I retrieve them.
Hany
New User
Posts: 19
Joined: Fri Jan 04, 2008 12:13 pm
First Name: Hany
Last Name: Elemary
Company Name: Profound Logic Software
Contact:

Re: Retrieve the User Id of the signed in user

Post by Hany »

There are two different authentication methods in Atrium:

  • - HTTP Basic

  • - Request Parameter


The HTTP Basic method uses the sign on credentials provided by the system’s configured HTTP Apache web server instance. This sign on method is appropriate when the web server has been configured to validate users against IBM i user profiles or a validation list.

If you use the HTTP Basic method, you can retrieve the logged in user ID through this call in your RPGsp program:

Code: Select all

RPGspIn('REMOTE_USER' : 'Env');
The Request Parameter method uses sign-on credentials from DB2 database files and passes them along to the web application as encoded parameters. This sign on method is appropriate for user-defined profiles or when setting up System i profiles for all users is not desirable. We do offer APIs with Atrium that helps in decoding the sign on credentials and validating them against the database files. Let me know if you're interested in this.

Thanks,

Hany
JamesMayor
New User
Posts: 13
Joined: Wed Oct 07, 2009 12:12 pm
First Name: James
Last Name: Mayor
Company Name: Gazelle Book Services Ltd
Phone: 01524 528521
Address 1: White Cross Mills
Address 2: Hightown
City: Lancaster
State / Province: Outside Canada/USA
Zip / Postal Code: LA1 4XS
Country: United Kingdom
Contact:

Re: Retrieve the User Id of the signed in user

Post by JamesMayor »

I am using IBM i profiles, not sure how to check whether I am using HTTP Basic but I have tried using the RPGspIn('REMOTE_USER' : 'Env'); method but get blanks returned for the User Id. Where in Atrium can I check whether I am using the HTTP Basic method.
Hany
New User
Posts: 19
Joined: Fri Jan 04, 2008 12:13 pm
First Name: Hany
Last Name: Elemary
Company Name: Profound Logic Software
Contact:

Re: Retrieve the User Id of the signed in user

Post by Hany »

You can set this option in Atrium's Control Panel under the Navigation Tab. When creating your navigation item. You need to set the "Action type" option to "Web Application", check the "Authenticate" checkbox and then select "HTTP Basic" from the "Authentication method" drop down field.

For more information, you can download our latest Atrium webinar recording here:

http://www.profoundlogic.com/webinars.rpgsp?id=899

Hany
JamesMayor
New User
Posts: 13
Joined: Wed Oct 07, 2009 12:12 pm
First Name: James
Last Name: Mayor
Company Name: Gazelle Book Services Ltd
Phone: 01524 528521
Address 1: White Cross Mills
Address 2: Hightown
City: Lancaster
State / Province: Outside Canada/USA
Zip / Postal Code: LA1 4XS
Country: United Kingdom
Contact:

Re: Retrieve the User Id of the signed in user

Post by JamesMayor »

I still get blanks returned, does Atrium need to be using HTTPS for this to work and if so where is this configured.

Note: Once the web site is live HTTPS will be used anyway but at the moment I am in a development environment.
mbconsul
New User
Posts: 7
Joined: Tue Jun 09, 2009 11:22 am
First Name: Marty
Last Name: Bumgarner
Company Name: Parkdale Mills
Phone: 704-874-5102
State / Province: North Carolina
Country: United States
Contact:

Re: Retrieve the User Id of the signed in user

Post by mbconsul »

Was there ever an answer to the last question here? We use the same arrangement and do not need to set up ssl for development. Also we do not want to have to create system profiles for customers and vendors to access their respective portals
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Retrieve the User Id of the signed in user

Post by David »

In order to authenticate to the RPGsp pages from Atrium, you'd need to run the pages under the PROFOUNDUI HTTP server.

You can do that by setting up a ScriptAlias directive in your HTTP server configuration to point to your RPGsp pages. There is already a sample ScriptAlias directive in there for RPGsp.

To require sign on with OS/400 profiles for the RPGsp pages, you'd then need to include a section in your configuration like this:

Code: Select all


<Location /rpgsp>                      
    Require valid-user                                                                               
    AuthType Basic                                                                                   
    AuthName "RPGsp"                                                                           
    PasswdFile %%SYSTEM%%                                                                            
    UserID %%CLIENT%%                                                                                
</Location>                                                                                    

After doing that setup, you should be able to run your RPGsp pages through the PROFOUNDUI HTTP server like this:

http://Systemi:8080/rpgsp/mypage.pgm

You'll be prompted to sign on when running the page that way.

You can then setup the item in Atrium using a URL like this:

/rpgsp/mypage.pgm

And then use the HTTP Basic authentication method. The user will not have to sign into the page again when launching through Atrium in this way.
mbconsul
New User
Posts: 7
Joined: Tue Jun 09, 2009 11:22 am
First Name: Marty
Last Name: Bumgarner
Company Name: Parkdale Mills
Phone: 704-874-5102
State / Province: North Carolina
Country: United States
Contact:

Re: Retrieve the User Id of the signed in user

Post by mbconsul »

Where can I find documentation on the parameters that are passed to web programs from Atrium when using DB2 authentication?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Retrieve the User Id of the signed in user

Post by David »

There is one parameter that is sent that is called AT_AUTH. This is an encoded parameter that cannot be read directly.

See /COPY member at PROFOUNDUI/QRPGLEINC,PUIATAUTH

This includes prototypes for the API which can decode the parameter. You can call Authenticate() to return the signed in user profile when running in this mode. It will return the user profile. It also has an error parameter that will return an error message or blanks on success.

The IsAuthorized() function will accept a user profile name, an Atrium menu item number and return an *On/*Off flag to indicate whether or not the user is authorized to that menu option.

Note that when calling RPGsp pages, you'll need to ensure that the 'AT_AUTH' URL parameter is maintained. This is passed on the URL when opening the page. From then on, it's up to the page to make this parameter persist between any page reloads. This can be done by reading the parameter with RPGspIn() and putting into a hidden form field, and also by passing along on the URL to any linked pages.

To use these APIs, bind to service program PUIATAUTH.

Please note, that the Authenticate() function and AT_AUTH parameters are not used when dealing with OS/400 profiles.

In that case, you would just use the REMOTE_USER enviornment variable to retrieve the user profile.
User avatar
Rob
Profound Logic Staff Member
Posts: 135
Joined: Fri Jan 04, 2008 12:12 pm
First Name: Rob
Last Name: Ferguson
Company Name: Profound Logic Software
Contact:

Re: Retrieve the User Id of the signed in user

Post by Rob »

The above post is referring to an RPGsp application within Atrium (not a Profound UI application)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests