users@glassfish.java.net

Application Client Login Questions

From: <glassfish_at_javadesktop.org>
Date: Tue, 20 May 2008 16:50:51 PDT

Hi,

I'm writing an application-client that access some secured EJB hosted on my GlassFish server. I've annotated my EJB method with @RolesAllowed so that only certain roles can invoke the method.

Everything works fine, and based on my observation this is how things happen:

1. Application client (launched using Web Start) trying to inject the secured EJB.
2. GlassFish see that the application client is trying to inject the EJB.
3. GlassFish calls the default CallbackHandler to get user login.
4. The default CallbackHanlder appears on the client's screen.

Now comes my questions:

1. If I click on "Cancel" on the default CallbackHandler dialog, or provide an invalid login, I will get a NamingException, and the application-client would exit. Where can I write code to handle this exception. For example, I might want to have the user try several times before the application-client exits, or I might want to have the application-client end gracefully when user clicks on "Cancel".

2. Is it possible to have the application-client initiate the login, before the EJB injection?

I would appreciate any pointers.
[Message sent by forum member 'bentsou' (bentsou)]

http://forums.java.net/jive/thread.jspa?messageID=275608