File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
raminaa niilian
Ranch Hand
Posts: 551
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 551
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic