Skip to main content

Security Roles

5 replies [Last post]
Anonymous

Hello,

I have a question in security roles/groups. My web app authentication login
form/security is working well but I want to control the jsp pages depending
on the user Roles.

For example:

if Role == admin {
//do this
} else {
//do this
}

I tried the isUserInRole but it does not work. I use jdbc realm
authentication. Any suggestions? :)

--
View this message in context: http://www.nabble.com/Security-Roles-tp21535982p21535982.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Venugopal Rao K

bfscom wrote:
> Hello,
>
> I have a question in security roles/groups. My web app authentication login
> form/security is working well but I want to control the jsp pages depending
> on the user Roles.
>
> For example:
>
> if Role == admin {
> //do this
> } else {
> //do this
> }
>
> I tried the isUserInRole but it does not work. I use jdbc realm
> authentication. Any suggestions? :)
>
send us your web.xml and sun-web.xml
Regards,
Venu

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

bfscom

Here's my web.xml


Admin Pages
/view/*


admin



All Pages
/*


user
admin


FORM
jdbc

/login.jsp /login.jsp

Here's my sun-web.xml

user
user


admin
admin

The security constraint is working too. I just can't get the roles

--
View this message in context: http://www.nabble.com/Security-Roles-tp21535982p21536183.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Venugopal Rao K

assuming your roles are declared, what does get |*getUserPrincipal
*()|
return.

Regards,
Venu
> Here's my web.xml
>
>
> Admin Pages
> /view/*
>

>
> admin
>

>

>
>
>
>
> All Pages
> /*
>

>
> user
> admin
>

>

>
>
> FORM
> jdbc
>
>
/login.jsp >
/login.jsp >
>

>
> Here's my sun-web.xml
>
> user
> user
>

>
> admin
> admin
>

>
>
>
> The security constraint is working too. I just can't get the roles
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

bfscom

Hi venu,

It displays the username
--
View this message in context: http://www.nabble.com/Security-Roles-tp21535982p21537628.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Venugopal Rao K

I don't see a reason for it to fail, it will help if you can send us a
reproducible test case.
Regards,
Venu

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net