class Crabbit::OAuth2SaslAuthenticator

Overview

Shared SASL PLAIN authenticator backed by an OAuth 2 token provider.

Configuration creates one instance automatically from OAuth2Config and shares it across every environment connection. Construct it directly when supplying a custom OAuth2TokenProvider.

Defined in:

crabbit/oauth2.cr

Constructors

Instance Method Summary

Instance methods inherited from class Crabbit::SaslAuthenticator

challenge(data : Bytes) : Bytes challenge, initial_response : Bytes initial_response, mechanism : String mechanism

Constructor Detail

def self.new(config : OAuth2Config, provider : OAuth2TokenProvider = OAuth2HttpTokenProvider.new(config)) #

Creates an authenticator using provider for token retrieval.


[View source]

Instance Method Detail

def config : OAuth2Config #

Returns the OAuth 2 refresh configuration.


[View source]
def initial_response : Bytes #

Returns a PLAIN initial response containing the current bearer token.

The token is retrieved lazily and refreshed if expired. Environment connections additionally register for proactive live re-authentication.


[View source]
def mechanism : String #

Returns "PLAIN", the RabbitMQ OAuth 2 SASL transport mechanism.


[View source]