Skip to main content

Login context for multiple contexts

4 replies [Last post]
lrbh
Offline
Joined: 2008-07-03
Points: 0

Hello All

can I create a web context that can handle the logging in for itself and other contexts?

For example,
(first NB project, web app) host:8080/root
has login.jsp, error.jsp and index.jsp (available after logging in, with links to root/app1 and root/app2)

(second NB project, ent app with web and ejb) host:8080/root/app1
(third NB project, another ent app) host:8080/root/app2

My attempts so far have the following effect:
1. attempt to navigate directly to root/app1
2. server redirects to root/login.jsp
3. login okay, so redirected to root/index.jsp

So far, so good, but now it goes wrong
4. click link to root/app1
5. server redirects to root/login.jsp, as in step 2

Any advice gratefully received

Regards
Rik

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lrbh
Offline
Joined: 2008-07-03
Points: 0

The behaviour of the app has changed. After setting sso-enabled to true in domain.xml, deploying app1 now gives the following in the GlassFish output:

DPL8007: Invalid Deployment Descriptors element setAuthenticationMethod value class com.sun.enterprise.deployment.LoginConfigurationImpl
DPL8007: Invalid Deployment Descriptors element auth-method value form
DPL5032:An authentication method was not defined in the web.xml descriptor. Using default BASIC for login configuration.

Sure enough, attempting to access root/app1 causes the basic auth pop-up to appear.

In app1's web.xml, what should go into 'auth-method', if not 'form'?

Cheers

lrbh
Offline
Joined: 2008-07-03
Points: 0

>
> In app1's web.xml, what should go into 'auth-method', if not 'form'?
>

'FORM' -- dim bulb! You could [i]almost[/i] say it's working now.

This thread seems a bit confused, so if you'll bear with me I'll recap what I'm trying to achieve and where I've got. The apps deployed to root and root/app1 are each in its own context

1. attempt to navigate root/app1
2. server redirects to root/login.jsp
3. login okay
4. server redirects to root (showing root/index.jsp)

It's the last point that is the drawback. Ideally, the server should redirect to root/app1 (showing root/app1/index.jsp).

If anyone can offer any suggestions, I'd be grateful.

Cheers
Rik

whartung
Offline
Joined: 2003-06-13
Points: 0

On glassfish you can configure Single Sign On (SSO), which will let you log in across contexts. This is built in to the container, not an external add on (like OpenSSO). But it only works on a single instance of Glassfish (or a cluster) vs across applications deployed on different servers.

lrbh
Offline
Joined: 2008-07-03
Points: 0

Thanks for that. I'll have a look into it.