Source:
public Authentication authenticate(final Authentication authentication) throws AuthenticationException { logger.debug("authentication: {}", authentication); if (!supports(authentication.getClass())) { logger.debug("unsupported authentication class: {}", authentication.getClass()); return null; } final ClientAuthenticationToken token = (ClientAuthenticationToken) authentication; final Credentials credentials = (Credentials) authentication.getCredentials(); logger.debug("credentials: {}", credentials); final String clientName = token.getClientName(); final Client client = this.clients.findClient(clientName); final WebContext context = token.getContext(); UserProfile userProfile = null; try { userProfile = client.getUserProfile(credentials, context); } catch (RequiresHttpAction requiresHttpAction) { throw new AuthenticationCredentialsException(requiresHttpAction.getMessage(), requiresHttpAction); } logger.debug("userProfile: {}", userProfile); Collection<? extends GrantedAuthority> authorities = new ArrayList<>(); UserDetails userDetails = null; if (this.userDetailsService != null) { final ClientAuthenticationToken tmpToken = new ClientAuthenticationToken(credentials, clientName, context, userProfile, null); userDetails = this.userDetailsService.loadUserDetails(tmpToken); logger.debug("userDetails: {}", userDetails); if (userDetails != null) { this.userDetailsChecker.check(userDetails); authorities = userDetails.getAuthorities(); logger.debug("authorities: {}", authorities); } } final ClientAuthenticationToken result = new ClientAuthenticationToken(credentials, clientName, context, userProfile, authorities, userDetails); result.setDetails(authentication.getDetails()); logger.debug("result: {}", result); return result; }

Target:
public Authentication authenticate(final Authentication authentication) throws AuthenticationException { logger.debug("authentication: {}", authentication); if (!supports(authentication.getClass())) { logger.debug("unsupported authentication class: {}", authentication.getClass()); return null; } final ClientAuthenticationToken token = (ClientAuthenticationToken) authentication; final Credentials credentials = (Credentials) authentication.getCredentials(); logger.debug("credentials: {}", credentials); final String clientName = token.getClientName(); final Client client = this.clients.findClient(clientName); final WebContext context = token.getContext(); UserProfile userProfile = null; try { userProfile = client.getUserProfile(credentials, context); } catch (RequiresHttpAction requiresHttpAction) { logger.debug("HTTP action required", requiresHttpAction.getMessage()); return null; } logger.debug("userProfile: {}", userProfile); Collection<? extends GrantedAuthority> authorities = new ArrayList<>(); UserDetails userDetails = null; if (this.userDetailsService != null) { final ClientAuthenticationToken tmpToken = new ClientAuthenticationToken(credentials, clientName, context, userProfile, null); userDetails = this.userDetailsService.loadUserDetails(tmpToken); logger.debug("userDetails: {}", userDetails); if (userDetails != null) { this.userDetailsChecker.check(userDetails); authorities = userDetails.getAuthorities(); logger.debug("authorities: {}", authorities); } } final ClientAuthenticationToken result = new ClientAuthenticationToken(credentials, clientName, context, userProfile, authorities, userDetails); result.setDetails(authentication.getDetails()); logger.debug("result: {}", result); return result; }