Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA: get entity for current user  RSS feed

 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

given a typical web application,

secured with JAAS, using a realm that maps to a table "User" in a database, and having an entity (JPA) User, which maps to the same table "User" which JAAS uses to authenticate and authorise -

what is the best way to retrieve an instance of User (e. g. in a Servlet), corresponding to the one who is currently logged in?

It is a good idea to use the same table for JAAS and inside the application, isn't it?

Kai
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!