Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

j_security_check and user info

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am using an App Servers authentication mechanism with j_security_check what would be a good way to get additional user information stored in a Bean for use in the web app?
Is there anyway to say "Once the user is logged in do this..." immediatly after you authenticate to the server?
Or am I stuck with getting this information from the database, worst case, the first time it is needed. Of course then I add another "Does this exist yet" check in my code. Ugh!
Thanks.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think I understand your question thoroughly. form-based authentication is just that, the container just checks against your roles, users, realm, etc; but that's about it.
if you need to fetch additional information from that user, I guess you'll have to go an look it up in the database.
maybe I'm the only one not fully understanding your question...
[ January 06, 2004: Message edited by: Andres Gonzalez ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
j_security_check implied he is using FORM based authentication, not BASIC. (I'm not sure why they always capitalise these).
One method that sometimes works is to submit to your own servlet then forward to the j_security_check servlet. Another is to have a base servlet that all servlets extend, then have that look at each request, find any that have the Remote User set, but hasn't been loaded, and then load the user. You could do this with a filter too.
Dave
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you're right, I was editing my posts while you were posting
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic