|
|
Re: Eclipse JAAS - registerListener() [message #125471 is a reply to message #125432] |
Tue, 03 February 2009 15:42 |
Lars Martin Messages: 24 Registered: July 2009 |
Junior Member |
|
|
Oleg Besedin wrote:
>> But how do I register my login dialog that implements CallbackHandler and
>> ILoginContextListener if the callbackhandler is defined in plugin.xml as
>> an extension?
>
> Not sure if I understand the question. I imagine that those would be two
> separate classes: dialog collects information from the user and passes it
> via callbacks to the login module; the listener does something as a reaction
> to the login status. For instance, such listener could be used to display a
> "lock" icon in the status bar.
>
> The login dialog can be registered with the extension point
> "org.eclipse.equinox.security.callbackHandler".
>
> The ILoginContextListener has this method:
> /**
> * This method is called after login sequence is finished. If login
> * exception is not null, the login failed.
> * @param subject the subject being authenticated, might be
> <code>null</code>
> * if there is no subject associated the context at this time
> * @param loginException <code>null</code> if login succeeded, otherwise
> contains
> * exception caused login to fail
> */
> void onLoginFinish(Subject subject, LoginException loginException);
>
>
> (There is some sample code in the "org.eclipse.equinox.security.sample"
> bundle in the equinox-incubator/security in the "/cvsroot/eclipse"
> repository. I am not sure if anybody supports that code at this time, but
> you can have a look at the KeyStoreLoginDialog as a starting point.)
>
> Sincerely,
> Oleg Besedin
Hi Oleg, thanks for your reply.
Yes, I've registered the CallbackHandler via plugin.xml. This callback
handler (a RAP/RCP dialog) collects the user input.
Now I wish to notify the user if the login doesn't not suceed (password
doesn't match). The notification should be done in the same dialog, the
dialog can stay open and the user can verify/correct its login. So I
have to register a listener that implements ILoginContextListener. My
dialog implements CallbackHandler to collect the user input and
implements ILoginContextListener to notify the user in case of login errors.
The problem is that my login bundle doesn't know the callback handler
instance because it is declared with the extension point. This is
correct - the actual JAAS configuration is separated from application
code. If my dialog also implements ILoginContextListener to notify the
user I can not register that listener because I do not have an instance.
secureContext.registerListener( ? );
Btw whats the current state of Eclipse JAAS? Does any roadmap exist?
Regards, Lars
|
|
|
Powered by
FUDForum. Page generated in 0.03959 seconds