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:
-
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
ConstructorsConstructorDescriptionStompOAuth2ClientCredentialsWithRefreshProvider(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
Methods inherited from class com.finconsgroup.itserr.messaging.security.OAuth2ClientCredentialsProvider
getPassword, isAboutToExpireMethods inherited from class com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider
checkContentType, checkResponseCode, configureConnection, configureConnectionForHttps, equals, extractResponseBody, getUsername, hashCode, parseToken, passwordFromToken, retrieveToken, timeBeforeExpiration, usernameFromTokenMethods inherited from class com.rabbitmq.client.impl.RefreshProtectedCredentialsProvider
getTimeBeforeExpirationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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 URIclientId- the OAuth2 client IDclientSecret- the OAuth2 client secretgrantType- 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:
refreshin interfacecom.rabbitmq.client.impl.CredentialsProvider- Overrides:
refreshin classcom.rabbitmq.client.impl.RefreshProtectedCredentialsProvider<com.rabbitmq.client.impl.OAuth2ClientCredentialsGrantCredentialsProvider.Token>
-