Class ServiceClientRegistrationMapper

java.lang.Object
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.ServiceClientRegistrationMapper

@Component public class ServiceClientRegistrationMapper extends Object
Builds the OAuth2 client registrations of the service client from its settings: one for the client credentials grant and one for the token exchange grant, which share the client's identity and authentication.
  • Field Details

    • CLIENT_CREDENTIALS_REGISTRATION_ID

      public static final String CLIENT_CREDENTIALS_REGISTRATION_ID
      Registration id of the client credentials grant.
      See Also:
    • TOKEN_EXCHANGE_REGISTRATION_ID

      public static final String TOKEN_EXCHANGE_REGISTRATION_ID
      Registration id of the token exchange grant.
      See Also:
  • Constructor Details

    • ServiceClientRegistrationMapper

      public ServiceClientRegistrationMapper()
  • Method Details

    • clientCredentials

      public org.springframework.security.oauth2.client.registration.ClientRegistration clientCredentials(ServiceClientAuthProperties properties)
      Builds the registration of the client credentials grant.
      Parameters:
      properties - settings of the service client.
      Returns:
      the registration.
    • tokenExchange

      public org.springframework.security.oauth2.client.registration.ClientRegistration tokenExchange(ServiceClientAuthProperties properties)
      Builds the registration of the token exchange grant.
      Parameters:
      properties - settings of the service client.
      Returns:
      the registration.
    • registration

      private static org.springframework.security.oauth2.client.registration.ClientRegistration registration(String registrationId, org.springframework.security.oauth2.core.AuthorizationGrantType grantType, ServiceClientAuthProperties properties)
      Builds a registration.
      Parameters:
      registrationId - id of the registration.
      grantType - grant the registration is for.
      properties - settings of the service client.
      Returns:
      the registration.