Class UserInfoTokenServices

  • All Implemented Interfaces:
    org.springframework.security.oauth2.provider.token.ResourceServerTokenServices

    public class UserInfoTokenServices
    extends Object
    implements org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
    ResourceServerTokenServices that uses a user info REST service.
    Since:
    1.3.0
    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
    • Method Detail

      • setRestTemplate

        public void setRestTemplate​(org.springframework.security.oauth2.client.OAuth2RestOperations restTemplate)
      • loadAuthentication

        public org.springframework.security.oauth2.provider.OAuth2Authentication loadAuthentication​(String accessToken)
                                                                                             throws org.springframework.security.core.AuthenticationException,
                                                                                                    org.springframework.security.oauth2.common.exceptions.InvalidTokenException
        Specified by:
        loadAuthentication in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
        Throws:
        org.springframework.security.core.AuthenticationException
        org.springframework.security.oauth2.common.exceptions.InvalidTokenException
      • getPrincipal

        protected Object getPrincipal​(Map<String,​Object> map)
        Return the principal that should be used for the token. The default implementation delegates to the PrincipalExtractor.
        Parameters:
        map - the source map
        Returns:
        the principal or "unknown"
      • readAccessToken

        public org.springframework.security.oauth2.common.OAuth2AccessToken readAccessToken​(String accessToken)
        Specified by:
        readAccessToken in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices