cancel
Showing results for 
Search instead for 
Did you mean: 

MYSAPSSO2 cookie

Former Member
0 Kudos

Hello All,

I was wondering if there is a way to have a servlet deployed to an SAP J2EE (which the Portal is also deployed to) call the standard SAP NetWeaver login page and then upon successful authentication create a SAP Logon ticket. This way I can have the user call the servlet and then call a Portal app using SSO.

Cheers,

Mike

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Mike, isn`t it available out of box? AFAIK, sso ticket is created for all authenticated j2ee resources. Just checked with httpwatcher my test servlet - mysapsso2 cookie is there!

Former Member
0 Kudos

Hi Maksim,

I guess the key there is 'authenticated J2EE resources'. I created a simple 'Hello World!' servlet which I then deployed to an SAP J2EE. When I run it, it does not require any authentication... it just runs and shows the expected 'Hello World!!!'. So... I tried implementing the below code which does force authentication but does not seem to return an SAP logon ticket.

IUser user = UMFactory.getAuthenticator().getLoggedInUser(request, response);

if (null == user) {

UMFactory.getAuthenticator().forceLoggedInUser(request, response);

return;

}

Cheers,

Mike

former_member182294
Active Contributor
0 Kudos

You should change login modules configuration in web-j2ee-engine.xml

Add the following into your web-j2ee-engine.xml by direct editing or through wizard.

<login-module-configuration>

<login-module-stack>

<login-module>

<login-module-name>EvaluateTicketLoginModule</login-module-name>

<flag>sufficient</flag>

</login-module>

<login-module>

<login-module-name>BasicPasswordLoginModule</login-module-name>

<flag>requisite</flag>

</login-module>

<login-module>

<login-module-name>CreateTicketLoginModule</login-module-name>

<flag>optional</flag>

</login-module>

</login-module-stack>

<password-change-config/>

</login-module-configuration>

Then change your servlet to check if its generating the SSO cookie or not by this way:

Cookie[] cookies = request.getCookies();

String cookieName = "MYSAPSSO2";//SAPCookie;

for ( int i=0; i<cookies.length; i++)

{

Cookie cookie = cookies<i>;

if (cookieName.equals(cookie.getName()))

{

response.getWriter().write("Got SSO cookie value= "+cookies<i>.getValue());

}

}

Regards

Abhilash

Former Member
0 Kudos

Simple enough Thanks.

Answers (0)