users@glassfish.java.net

Re: Eclipse RCP client for Glassfish v2.1 using EJB3 -- Security Problems/Quest

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 May 2009 03:02:59 PDT

Sorry for the late reply...

>
> Our questions at this point:
>
>
> 1 - is it true that Glassfish doesn't support the
> passing of username/password via the InitialContext
> and you have to use ProgrammaticLogin, which does
> much of the same: it passes the username/password
> with each lookup call when requesting EJBs?

Yes.
>
> 2 - in addition you need to configure JAAS on the
> client. Is there anything else required on top of the
> configuration of the realm?
>

No

> 3 - when everything is working properly, are you
> supposed to call callerPrincipal.getName() and you
> see the user name you passed with
> ProgrammaticLogin.login? We are always getting
> ANONYMOUS!! What are we doing wrong?

Yes. Have you tried supplying a user that does not exist on the server ?. Does it still pass through ?. If that happens then it means there is some problem with Configuration. But if an invalid username/password causes the access to be denied then you could be hinting at a bug in getCallerPrincipal().

The Docs are there, please see : http://docs.sun.com/source/817-6087/dgacc.html

ofcourse there is a bug there, it asks you to call LoginContextDriver.doClientLogin. This was a bug in docs. You should use Programmatic Login instead.

sorry again for the late reply.

Thanks.

>
> Please help as there is really not too much
> information out there on the web! Even a seemingly
> complete blog like
> http://blogbysud.blogspot.com/2007/10/programmatic-log
> in-to-authenticate.html has a comment in the end
> having the same problem we have.
>
> I have to say, GF makes a great impression, so we
> would like to start using it, but so far we've had
> much more difficulty than when we started using JBoss
> a few years ago. There must be a simpler way of using
> GF!
>
> Your help is appreciated (as you can tell, we're
> getting a bit frustrated)... :- )
>
> - Andreas
[Message sent by forum member 'kumarjayanti' (kumarjayanti)]

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