NAME

Twilio::AuthStrategy::AuthStrategy - Base class for how a request is authenticated

DESCRIPTION

A credential provider, such as Twilio::CredentialProvider::ClientCredentialProvider, returns an auth strategy, and the client asks it for the Authorization header of each request. Applications set a provider on the client and don't use strategies directly.

METHODS

new

my $strategy = Twilio::AuthStrategy::AuthStrategy->new($auth_type);

get_auth_type

Returns the name given to "new", such as token.

get_auth_string

my $header = $strategy->get_auth_string($client);

Returns the value of the Authorization header. $client is the Twilio::Rest::Client making the request. Subclasses must implement it.

requires_authentication

Returns true when requests need an Authorization header. Subclasses must implement it.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.