The initialise() method is marked "Final" in the AbstractLoginModule class .
Hence, my LoginModule cannot override this method - to be able to initialise
my callBackHandler object as below:
MyLoginModule.initialise():
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map sharedState, Map options)
{
this.subject = subject;
this.callbackHandler = callbackHandler;
this.sharedState = sharedState;
this.options = options;
debug = "true".equalsIgnoreCase((String)options.get("debug"));
}
After authentication, I would like to create the appropriate WikiPrincipals.
and my understanding is that it can be done like below if my LoginModule
extends AbstractLoginModule:
MyLoginModule.login():
...................................
//userName comes from MyCallbackHandler
String principalString = userName;
if ( principalString == null )
throw new FailedLoginException( "No user Principal
found" );
if (userType == null) {
throw new FailedLoginException("User Type (Role)
not found:"+userType);
}
WikiPrincipal principal = new WikiPrincipal(
principalString );
m_principals.add( principal );
if ("C".equalsIgnoreCase(userType)) {
System.out.println("userType is C -
Authenticated role");
m_principals.add(Role.AUTHENTICATED);
m_principals.add( Role.ALL );
m_principalsToOverwrite.add( WikiPrincipal.GUEST
);
return true;
}
else if ("A".equalsIgnoreCase(userType) ||
"T".equalsIgnoreCase(userType)) {
m_principals.add( Role.ANONYMOUS );
//m_principals.add( Role.ALL );
}
else {
m_principals.add( Role.ANONYMOUS );
m_principalsToRemove.add( Role.ANONYMOUS );
}
On Fri, Jun 6, 2008 at 2:23 AM, Janne Jalkanen <[EMAIL PROTECTED]>
wrote:
>
>> However, should MyLoginModule extend from AbstractLoginModule to be able
>> to
>> do that. If so, then I have an issue with initialising my callbackhandler
>> object in the loginmodule.
>>
>
> Exactly what issue do you have with initializing your callbackhandler in
> the loginmodule?
>
> /Janne