Class SecurityServiceOAuth2RequestFactory

  • All Implemented Interfaces:
    org.springframework.security.oauth2.provider.OAuth2RequestFactory

    public class SecurityServiceOAuth2RequestFactory
    extends Object
    implements org.springframework.security.oauth2.provider.OAuth2RequestFactory
    A custom request factory implementation that utilizes SecurityService to check that the requested scopes are valid for the request and current user.
    Author:
    Nick Crum (ncrum)
    • Constructor Detail

      • SecurityServiceOAuth2RequestFactory

        public SecurityServiceOAuth2RequestFactory​(SecurityService securityService,
                                                   org.springframework.security.oauth2.provider.ClientDetailsService clientDetailsService)
    • Method Detail

      • createAuthorizationRequest

        public org.springframework.security.oauth2.provider.AuthorizationRequest createAuthorizationRequest​(Map<String,​String> authorizationParameters)
        Specified by:
        createAuthorizationRequest in interface org.springframework.security.oauth2.provider.OAuth2RequestFactory
      • createOAuth2Request

        public org.springframework.security.oauth2.provider.OAuth2Request createOAuth2Request​(org.springframework.security.oauth2.provider.AuthorizationRequest request)
        Specified by:
        createOAuth2Request in interface org.springframework.security.oauth2.provider.OAuth2RequestFactory
      • createTokenRequest

        public org.springframework.security.oauth2.provider.TokenRequest createTokenRequest​(Map<String,​String> tokenParameters,
                                                                                            org.springframework.security.oauth2.provider.ClientDetails authenticatedClient)
        Specified by:
        createTokenRequest in interface org.springframework.security.oauth2.provider.OAuth2RequestFactory
      • createTokenRequest

        public org.springframework.security.oauth2.provider.TokenRequest createTokenRequest​(org.springframework.security.oauth2.provider.AuthorizationRequest authorizationRequest,
                                                                                            String grantType)
        Specified by:
        createTokenRequest in interface org.springframework.security.oauth2.provider.OAuth2RequestFactory
      • createOAuth2Request

        public org.springframework.security.oauth2.provider.OAuth2Request createOAuth2Request​(org.springframework.security.oauth2.provider.ClientDetails client,
                                                                                              org.springframework.security.oauth2.provider.TokenRequest tokenRequest)
        Specified by:
        createOAuth2Request in interface org.springframework.security.oauth2.provider.OAuth2RequestFactory
      • getRequestedScopes

        protected Set<String> getRequestedScopes​(Map<String,​String> authorizationParameters,
                                                 org.springframework.security.oauth2.provider.ClientDetails clientDetails)