I have a basic question. I have a login page. Sorry here it is view. So i have a login view.
Once i got authenticated, I have to be redirected to user view page. This can be achieved through changing the view somehow. This is not the question here.
But my question is, after i entered into the user’s view, How can i get the authenticated information?
That means, How can i check the user is authenticated? For normal web application, we have session kind of stuff. From the session we can get the authenticated user information.
Can any one help me, how can i get this information?
How is the authentication is done in your application ?
If you use http basic, e.g. your container handles this, then you need query http servlet request (like Joonas suggested) for the principal that is set by the container once authentication is done.
If you handle authentication by yourself, e.g. have a login window, implemented in your application, then you do not need to dig into http session or servlet request. Just store whatever you like about authenticated user in the application instance, as each session has it’s own application instance associated.
Using ThreadLocal pattern you may get access to the current application instance from any part of your toolkit application UI and check user-specific parameters, stored in the application instance after authentication.