cancel
Showing results for 
Search instead for 
Did you mean: 

Access user information from SAP Logon Ticket Java Web Application

Former Member
0 Kudos

Dear Experts,

I am looking for a way to access the userid from a SAP Logon Ticket in a Java web application deployed on Netweaver AS Java server.  How can I extract the userid from the SAP Logon Ticket cookie using Java or Javascript?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bradley,

I'd suggest you enable authentication for your app and use the IUser interface.

This also allows you to access other data for the logged in user and will work independant, whether he logged in using Logon Tickets, SAML, X.509 or or other methods.

Regards,

Patrick

Former Member
0 Kudos

Hi Patrick,

Can you please provide an example on how to use this?  This is just an interface is there an implementation out there somewhere?

Thanks,

Former Member
0 Kudos

Hi Bradley,

please check this presentation in the user management functions of the SAP J2EE engine.

You will need to include the UME library (com.sap.security.api.sda)


You use the functions provided by the UMFactory
There are two available functions:

    • getLoggedInUser()
    • forceLoggedInUser()

Use getLoggedInUser() to get an already logged on user‘s ID.

If the user is not yet logged on, use forceLoggedInUser() to show the logon screen.


IUser user =
   
UMFactory.getAuthenticator().getLoggedInUser(request, response);
if (null == user) {
   
UMFactory.getAuthenticator().forceLoggedInUser(request, response);
 
return;
}

For WebDynpro, you can find an example here.

For a portal environment, you can find some info in the presentation mentioned above.

Kind regards,

Patrick

Former Member
0 Kudos

Hi Patrick,

Thank you so much for your help!

Thanks,

Bradley Sorensen

Answers (0)