Class StompOAuth2ClientCredentialsWithRefreshProvider

java.lang.Object
com.rabbitmq.client.impl.RefreshProtectedCredentialsProvider<com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.Token>
com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider
com.finconsgroup.itserr.messaging.security.OAuth2ClientCredentialsProvider
com.finconsgroup.itserr.marketplace.usercommunication.dm.security.StompOAuth2ClientCredentialsWithRefreshProvider
All Implemented Interfaces:
com.rabbitmq.client.impl.CredentialsProvider, com.rabbitmq.stream.sasl.CredentialsProvider, com.rabbitmq.stream.sasl.UsernamePasswordCredentialsProvider

public class StompOAuth2ClientCredentialsWithRefreshProvider extends com.finconsgroup.itserr.messaging.security.OAuth2ClientCredentialsProvider
An Stomp OAuth2 credentials provider for RabbitMQ.

This provider authenticates with RabbitMQ using OAuth2 by exchanging client credentials (client ID and secret) for an access token at the specified token endpoint. The obtained token is then used for authentication with the RabbitMQ server acting as STOMP External Broker.

See Also:
  • OAuth2ClientCredentialsGrantCredentialsProvider
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider

    com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.OAuth2ClientCredentialsGrantCredentialsProviderBuilder, com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.TlsConfiguration, com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.Token
  • Constructor Summary

    Constructors
    Constructor
    Description
    StompOAuth2ClientCredentialsWithRefreshProvider(String tokenEndpointUri, String clientId, String clientSecret, String grantType, Map<String,String> parameters, Duration refreshDelay, Duration refreshPeriod, ScheduledExecutorService scheduledExecutor, org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler stompBrokerRelayMessageHandler)
    Constructs a new OAuth2 client credentials provider with the specified OAuth2 configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    Start the refresh for OAuth2 credentials

    Methods inherited from class com.finconsgroup.itserr.messaging.security.OAuth2ClientCredentialsProvider

    getPassword, isAboutToExpire

    Methods inherited from class com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider

    checkContentType, checkResponseCode, configureConnection, configureConnectionForHttps, equals, extractResponseBody, getUsername, hashCode, parseToken, passwordFromToken, retrieveToken, timeBeforeExpiration, usernameFromToken

    Methods inherited from class com.rabbitmq.client.impl.RefreshProtectedCredentialsProvider

    getTimeBeforeExpiration

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.rabbitmq.stream.sasl.UsernamePasswordCredentialsProvider

    getUsername
  • Constructor Details

    • StompOAuth2ClientCredentialsWithRefreshProvider

      public StompOAuth2ClientCredentialsWithRefreshProvider(String tokenEndpointUri, String clientId, String clientSecret, String grantType, Map<String,String> parameters, Duration refreshDelay, Duration refreshPeriod, ScheduledExecutorService scheduledExecutor, org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler stompBrokerRelayMessageHandler)
      Constructs a new OAuth2 client credentials provider with the specified OAuth2 configuration.
      Parameters:
      tokenEndpointUri - the OAuth2 token endpoint URI
      clientId - the OAuth2 client ID
      clientSecret - the OAuth2 client secret
      grantType - the OAuth2 grant type (default "client_credentials")
      refreshDelay - represents how soon before expiration the token should be refreshed.
      scheduledExecutor - the scheduled executor to use to configure token refresh
  • Method Details

    • start

      @PostConstruct public void start()
      Start the refresh for OAuth2 credentials
    • refresh

      public void refresh()
      Specified by:
      refresh in interface com.rabbitmq.client.impl.CredentialsProvider
      Overrides:
      refresh in class com.rabbitmq.client.impl.RefreshProtectedCredentialsProvider<com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.Token>