/** * Template method for retrieving the UserDetails based on the assertion. Default is * to call configured userDetailsService and pass the username. Deployers can override * this method and retrieve the user based on any criteria they desire. * * @param assertion The CAS Assertion. * @return the UserDetails. */ protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); }
/** * Template method for retrieving the UserDetails based on the federation response (wresult parameter). * * @param response The WS Federation response * @return the UserDetails. */ protected UserDetails loadUserByFederationResponse(final FedizResponse response) { final FederationResponseAuthenticationToken token = new FederationResponseAuthenticationToken(response); return this.authenticationUserDetailsService.loadUserDetails(token); }
/** * Template method for retrieving the UserDetails based on the federation response (wresult parameter). * * @param response The WS Federation response * @return the UserDetails. */ protected UserDetails loadUserByFederationResponse(final FedizResponse response) { final FederationResponseAuthenticationToken token = new FederationResponseAuthenticationToken(response); return this.authenticationUserDetailsService.loadUserDetails(token); }
/** * Template method for retrieving the UserDetails based on the assertion. Default is * to call configured userDetailsService and pass the username. Deployers can override * this method and retrieve the user based on any criteria they desire. * * @param assertion The CAS Assertion. * @return the UserDetails. */ protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); }
/** * Template method for retrieving the UserDetails based on the assertion. Default is * to call configured userDetailsService and pass the username. Deployers can override * this method and retrieve the user based on any criteria they desire. * * @param assertion The CAS Assertion. * @return the UserDetails. */ protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); }
public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (supports(authentication.getClass())) { JanrainAuthenticationToken janrainAuthenticationToken = (JanrainAuthenticationToken) authentication; UserDataResponse userDataResponse = janrainAuthenticationToken.getUserDataResponse(); UserDetails userDetails = null; if (authenticationUserDetailsService == null) { userDetails = new JanrainUserDetails(userDataResponse); } else { userDetails = authenticationUserDetailsService.loadUserDetails(janrainAuthenticationToken); } return new JanrainAuthenticationToken(userDetails, userDetails == null ? null : userDetails.getAuthorities(), userDataResponse); } return null; }
.loadUserDetails((PreAuthenticatedAuthenticationToken) authentication);
@Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!delegate.supports(authentication.getClass())) { return null; } try { AuthenticationHolder.setAuthentication(authentication); Authentication delegatedAuth = delegate.authenticate(authentication); if (!groupsAreManagedInStudio) { return delegatedAuth; } if (delegatedAuth != null) { UserDetails userDetails = authenticationUserDetailsService.loadUserDetails(delegatedAuth); Collection<? extends GrantedAuthority> authorities = userDetails.getAuthorities(); UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( delegatedAuth.getPrincipal(), delegatedAuth.getCredentials(), authorities); authenticationToken.setDetails(userDetails); return authenticationToken; } return null; } finally { AuthenticationHolder.clear(); } }
@Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!delegate.supports(authentication.getClass())) { return null; } try { AuthenticationHolder.setAuthentication(authentication); Authentication delegatedAuth = delegate.authenticate(authentication); if (!groupsAreManagedInStudio) { return delegatedAuth; } if (delegatedAuth != null) { UserDetails userDetails = authenticationUserDetailsService.loadUserDetails(delegatedAuth); Collection<? extends GrantedAuthority> authorities = userDetails.getAuthorities(); UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( delegatedAuth.getPrincipal(), delegatedAuth.getCredentials(), authorities); authenticationToken.setDetails(userDetails); return authenticationToken; } return null; } finally { AuthenticationHolder.clear(); } }