implementing SSO with policy agent "Service URL not found:session"

Hi,

here is my env

policy agent 2.2 for sun app server 8.1

I have an application for which I want to implement SSO.Now I have installed agent on my app server and when I try to access my protected page I am redirected to Access Manager login page which is fine.

After that I get the page I want to access.So far so good.Now on this page I want to access the userid of the authenticated user.

I wrote the following code.

try {

SSOTokenManager ssoManager = SSOTokenManager.getInstance();

SSOToken ssoToken = ssoManager.createSSOToken(request);

if (ssoManager.isValidToken(ssoToken)) {

} else {

out.println("Token is not valid!!!");

}

try {

ssoManager.validateToken(ssoToken);

} catch (SSOException e) {

out.println("exception validate token!!!");

}

ssoManager.refreshSession(ssoToken);

} catch (SSOException e) {

out.println("general exception!!!"+e.getMessage());

}

I see the following on my page

general exception!!!Service URL not found:session

Can anybdy help me in resolving this.

Appreciate ur help.!

Regards.

[1205 byte] By [deepshara] at [2007-11-27 5:40:02]
# 1
You can pick up the userID by simply putting in request.getHeader("userid") in the page. The userid variable will probably need a map in AMAgent.properties (LDAP attribute map etc)Ankush
ankushkapoora at 2007-7-12 15:16:04 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

Ankush,

I tried that but I get null as the value.I see following properties in AmAgent.properties

com.sun.identity.agents.config.user.mapping.mode = USER_ID

com.sun.identity.agents.config.user.attribute.name = employeenumber

com.sun.identity.agents.config.user.principal = false

com.sun.identity.agents.config.user.token = UserToken

I tried getting user_id from session as well but I get null.

how can I get user id after successful authentication ? I thought it would be easy but seems like thts not the case.!!

any pointers?

deepshara at 2007-7-12 15:16:04 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3
why don't you trycom.sun.identity.agents.config.session.attribute.fetch.mode = REQUEST_ATTRIBUTEcom.sun.identity.agents.config.session.attribute.mapping[UserToken] = USER_ID
Aaron_Andersona at 2007-7-12 15:16:04 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4
Aaron,I tried that and It was working.!Thanks for your help...Regards!
deepshara at 2007-7-12 15:16:04 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5
Hey Guys..I would still like to understand why my code which was pasted in my first post doesnt work..?The "Service URL not found"..what does it mean?Thanks Again!
deepshara at 2007-7-12 15:16:04 > top of Java-index,Web & Directory Servers,Directory Servers...