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

danhaywood opened this Issue May 8, 2015 · 0 comments


None yet
1 participant

danhaywood commented May 8, 2015

... because PrincipalForApplicationUser does not actually implement, 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, but that might introduce some regressions. For now, suggest simply ensuring that toString() returns the principal name, to fix the immediate issue.

@danhaywood danhaywood closed this in 2b8fbe9 May 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment