Class ClientRegistration.Builder

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    ClientRegistration

    public static final class ClientRegistration.Builder
    extends java.lang.Object
    implements java.io.Serializable
    A builder for ClientRegistration.
    See Also:
    Serialized Form
    • Method Detail

      • clientAuthenticationMethod

        public ClientRegistration.Builder clientAuthenticationMethod​(org.springframework.security.oauth2.core.ClientAuthenticationMethod clientAuthenticationMethod)
        Sets the authentication method used when authenticating the client with the authorization server.
        Parameters:
        clientAuthenticationMethod - the authentication method used for the client
        Returns:
        the ClientRegistration.Builder
      • authorizationGrantType

        public ClientRegistration.Builder authorizationGrantType​(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType)
        Sets the authorization grant type used for the client.
        Parameters:
        authorizationGrantType - the authorization grant type used for the client
        Returns:
        the ClientRegistration.Builder
      • redirectUriTemplate

        @Deprecated
        public ClientRegistration.Builder redirectUriTemplate​(java.lang.String redirectUriTemplate)
        Deprecated.
        Sets the uri (or uri template) for the redirection endpoint.
        Parameters:
        redirectUriTemplate - the uri (or uri template) for the redirection endpoint
        Returns:
        the ClientRegistration.Builder
      • redirectUri

        public ClientRegistration.Builder redirectUri​(java.lang.String redirectUri)
        Sets the uri (or uri template) for the redirection endpoint.
        The supported uri template variables are: {baseScheme}, {baseHost}, {basePort}, {basePath} and {registrationId}.
        NOTE: {baseUrl} is also supported, which is the same as {baseScheme}://{baseHost}{basePort}{basePath}.
        Configuring uri template variables is especially useful when the client is running behind a Proxy Server. This ensures that the X-Forwarded-* headers are used when expanding the redirect-uri.
        Parameters:
        redirectUri - the uri (or uri template) for the redirection endpoint
        Returns:
        the ClientRegistration.Builder
        Since:
        5.4
      • authorizationUri

        public ClientRegistration.Builder authorizationUri​(java.lang.String authorizationUri)
        Sets the uri for the authorization endpoint.
        Parameters:
        authorizationUri - the uri for the authorization endpoint
        Returns:
        the ClientRegistration.Builder
      • userInfoAuthenticationMethod

        public ClientRegistration.Builder userInfoAuthenticationMethod​(org.springframework.security.oauth2.core.AuthenticationMethod userInfoAuthenticationMethod)
        Sets the authentication method for the user info endpoint.
        Parameters:
        userInfoAuthenticationMethod - the authentication method for the user info endpoint
        Returns:
        the ClientRegistration.Builder
        Since:
        5.1
      • userNameAttributeName

        public ClientRegistration.Builder userNameAttributeName​(java.lang.String userNameAttributeName)
        Sets the attribute name used to access the user's name from the user info response.
        Parameters:
        userNameAttributeName - the attribute name used to access the user's name from the user info response
        Returns:
        the ClientRegistration.Builder
      • issuerUri

        public ClientRegistration.Builder issuerUri​(java.lang.String issuerUri)
        Sets the issuer identifier uri for the OpenID Connect 1.0 provider or the OAuth 2.0 Authorization Server.
        Parameters:
        issuerUri - the issuer identifier uri for the OpenID Connect 1.0 provider or the OAuth 2.0 Authorization Server
        Returns:
        the ClientRegistration.Builder
        Since:
        5.4
      • providerConfigurationMetadata

        public ClientRegistration.Builder providerConfigurationMetadata​(java.util.Map<java.lang.String,​java.lang.Object> configurationMetadata)
        Sets the metadata describing the provider's configuration.
        Parameters:
        configurationMetadata - the metadata describing the provider's configuration
        Returns:
        the ClientRegistration.Builder
        Since:
        5.1