on 08-22-2007 11:14 PM
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.