aspose file tools*
The moose likes JSF and the fly likes how does JSF manage username /role , is there any standard ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how does JSF manage username /role , is there any standard ?" Watch "how does JSF manage username /role , is there any standard ?" New topic
Author

how does JSF manage username /role , is there any standard ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Hi
thank you for reading my post
is there any standard way to set and get role/username from session ?
for example should i use my own defined variable for role and user name or JSF provides an standard way for setting and getting user name and its role ?

thanks
Samba Siva Rao Kolusu
Greenhorn

Joined: Aug 25, 2006
Posts: 4
Hi!Raminaa,
It's the same as you do for Struts.
After all JSF does not have any in-built security features apart from Container managed security or a custom implementation of JAAS.
Anyway, it is the j_userName, and j_passWord for the user name and password fields(components in JSF world),and you can check for authorization by calling isUserinRole() method , and get a list of users bucalling gerUserPrincipals() method as you would have done in Struts.There is not much difference between JSF security and Struts security.
Infact, lately Mr.Frank Nimphius and Duncan Millis of Oracle Corp, have contributed some piece to this workpart of the frame, which you may have a look at on the following URL:



http://www.orablogs.com/fnimphius/archives/cat_j2ee_security.html


I hope this helps,
Regards,
Samba
raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
Thank you for your reply.
in struts i did not used container managed security and in jsf i do not want to use it eather as it is not portable between containers.

in struts login action i check user/pass with database and the set a variable in session like : logged_in=true , user_name=ramina , role=manager

i thought that we have some built-it variables for this stuff in jsf , and as i see we do not have any standard variable names for username / roles..


thank you again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how does JSF manage username /role , is there any standard ?
 
Similar Threads
security issue
getUserpricipal()
tomcat username password
JSF, roles and security-constraint
Authentication problems with MySQL and Tomcat 6.0