on 06-21-2004 4:26 PM
Hello ,
I'm trying to develop a class to be used in an authentication scheme so it needs to implement LoginModule interfaz and I want to get an IPortalComponentRequest in this class but I don't know how ( if it's possible ).
Do you know any method to do this ?
Thanks a lot and best regards
Fernando
Not sure about the IPortalComponentRequest,but you can geet a HttpServletRequest
public boolean login() throws LoginException {
if (callbackHandler == null) {
throw new LoginException("Error: no CallbackHandler available to garner authentication information from the user");
}
//TODO declare a Callback array (1 element) and
// assign a WebCallback object to the array
Callback[] callbacks = new Callback[1];
callbacks[0] = new WebCallback();
try {
callbackHandler.handle(callbacks);
//TODO get the user ID in the cookie from the request object (contained in the callbacks[0])
Cookie[] cookies =
((WebCallback) callbacks[0]).getRequest().getCookies();
for (int i=0; i<cookies.length; i++) {
Cookie c = cookies<i>;
if(debug)
System.out.println("cookie: " + c.getName() + " = "+c.getValue());
if (c.getName().equals(cookieName)) {
//TODO get the cookie value and decrypt it
userID = decrypt(c.getValue());
break;
}
}
}
(what you are looking for is ((WebCallback) callbacks[0]).getRequest()
(code taken for JAAS login example,https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/PRTL351.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.