/** * Creates a {@code Subject} instance for the user represented by the given method arguments. * * @param token the {@code AuthenticationToken} submitted for the successful authentication. * @param info the {@code AuthenticationInfo} of a newly authenticated user. * @param existing the existing {@code Subject} instance that initiated the authentication attempt * @return the {@code Subject} instance that represents the context and session data for the newly * authenticated subject. */ protected Subject createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing) { SubjectContext context = createSubjectContext(); context.setAuthenticated(true); context.setAuthenticationToken(token); context.setAuthenticationInfo(info); context.setSecurityManager(this); if (existing != null) { context.setSubject(existing); } return createSubject(context); }
/** * Creates a {@code Subject} instance for the user represented by the given method arguments. * * @param token the {@code AuthenticationToken} submitted for the successful authentication. * @param info the {@code AuthenticationInfo} of a newly authenticated user. * @param existing the existing {@code Subject} instance that initiated the authentication attempt * @return the {@code Subject} instance that represents the context and session data for the newly * authenticated subject. */ protected Subject createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing) { SubjectContext context = createSubjectContext(); context.setAuthenticated(true); context.setAuthenticationToken(token); context.setAuthenticationInfo(info); if (existing != null) { context.setSubject(existing); } return createSubject(context); }
/** * Required to by-pass a Shiro issue caused by not binding the SecurityManager globally. */ @Override protected SubjectContext createSubjectContext() { SubjectContext subjectContext = super.createSubjectContext(); subjectContext.setSecurityManager(this); return subjectContext; }
/** * Creates a {@code Subject} instance for the user represented by the given method arguments. * * @param token the {@code AuthenticationToken} submitted for the successful authentication. * @param info the {@code AuthenticationInfo} of a newly authenticated user. * @param existing the existing {@code Subject} instance that initiated the authentication attempt * @return the {@code Subject} instance that represents the context and session data for the newly * authenticated subject. */ protected Subject createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing) { SubjectContext context = createSubjectContext(); context.setAuthenticated(true); context.setAuthenticationToken(token); context.setAuthenticationInfo(info); if (existing != null) { context.setSubject(existing); } return createSubject(context); }