class Net::IMAP::SASL::OAuthBearerAuthenticator

the bearer token.
the resource server. TLS MUST be used for OAUTHBEARER to protect
Security (TLS) to secure the protocol interaction between the client and<br>RFC6750 requires Transport Layer<br><br>Net::IMAP#authenticate.<br>RFC6750. Use via
OAuth 2.0 bearer tokens, as described in<br>RFC7628. Authenticates using
Authenticator for the “OAUTHBEARER” SASL mechanism, specified in

def authorization; "Bearer #{oauth2_token}" end

Value of the HTTP Authorization header
def authorization; "Bearer #{oauth2_token}" end

def initial_response?; true end

+OAUTHBEARER+ sends an initial client response.

initial_response? -> true
:call-seq:
def initial_response?; true end

def initialize(arg1 = nil, arg2 = nil,

_or_ #port) as are specific server implementations.
require #authzid (or other parameters, such as #host
noting that application protocols are allowed to
Although only oauth2_token is required by this mechanism, it is worth

* _optional_ #port — Service port to which the client connected.
* _optional_ #host — Hostname to which the client connected.

#oauth2_token.
authentication identity is established for the client by
_authorization_ identity and not the _authentication_ identity. The
Note that, unlike some other authenticators, +username+ sets the

_optional_ #username — An alias for #authzid.

* _optional_ #authzid ― Authorization identity to act as or on behalf of.

The most common ones are:
{super}[rdoc-ref:OAuthAuthenticator::new] (see OAuthAuthenticator).
All other keyword parameters are passed to

* #oauth2_token — An OAuth2 bearer token

==== Parameters

Called by Net::IMAP#authenticate and similar methods on other clients.

Creates an Authenticator for the "+OAUTHBEARER+" SASL mechanism.

new(oauth2_token:, **options) -> authenticator
new(authzid, oauth2_token, **options) -> authenticator
new(oauth2_token, **options) -> authenticator
:call-seq:
def initialize(arg1 = nil, arg2 = nil,
               oauth2_token: nil, secret: nil,
               **args, &blk)
  username, oauth2_token_arg = arg2.nil? ? [nil, arg1] : [arg1, arg2]
  super(username: username, **args, &blk)
  @oauth2_token = oauth2_token || secret || oauth2_token_arg or
    raise ArgumentError, "missing oauth2_token"
end