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

calling httpServletRequest.getPrincipal().getName() does not return the user's name... #18

Closed
danhaywood opened this issue May 8, 2015 · 0 comments

Comments

@danhaywood
Copy link
Contributor

... because PrincipalForApplicationUser does not actually implement java.security.Principal, only Shiro's AuthorizationInfo and AuthenticationInfo interfaces.

This means that Shiro wraps it in an internal ObjectPrincipal. The getName() of ObjectPrincipal delegates to PrincipalForApplicationUser's toString() ... because so far a Shiro is concerned, it's just a java.lang.Object and there's nothing else to call.

Probably we should make our PrincipalForApplicationUser implement java.security.Principal, but that might introduce some regressions. For now, suggest simply ensuring that toString() returns the principal name, to fix the immediate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant