Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to persist the details of the user logged on #549

Closed
ankur021188 opened this issue Sep 14, 2017 · 1 comment
Closed

How to persist the details of the user logged on #549

ankur021188 opened this issue Sep 14, 2017 · 1 comment
Labels

Comments

@ankur021188
Copy link

Issue which I am facing is that, whenever I am using, new WindowsAuthProviderImpl().logonUser(userName, password), to authenticate a user, its getting authenticated, but the next time when Iam trying to access the username of the loggedin user when httpServletRequest.getRemoteUser(), its returning the value of the user loggedin the machine and not the user loggedin in the application.

What changes need to be done for the same?

@dblock
Copy link
Collaborator

dblock commented Sep 14, 2017

The WindowsAuthProviderImpl().logonUser(userName, password) call returns a context that you can (also) use to impersonate the current thread. But if you did this in a servlet, it wouldn't know anything about the current thread running and return you whatever the remote user was that made the HTTP request.

If you want httpServletRequest.getRemoteUser to return the remote user you need to setup SSO with a filter or such and make an HTTP request with a browser.

I'll close this, use the mailing list for questions, please.

@dblock dblock closed this as completed Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants