Auth0-PHP

SdkConfiguration
in package
implements ConfigurableContract uses ConfigurableMixin

FinalYes

Table of Contents

Interfaces

ConfigurableContract

Constants

STRATEGIES_USING_SESSIONS  : array<string|int, string> = [self::STRATEGY_REGULAR]
STRATEGY_API  : string = 'api'
STRATEGY_MANAGEMENT_API  : string = 'management'
STRATEGY_NONE  : string = 'none'
STRATEGY_REGULAR  : string = 'webapp'

Properties

$audience  : array<string|int, mixed>|null
$backchannelLogoutCache  : CacheItemPoolInterface|null
$backchannelLogoutExpires  : int
$clientAssertionSigningAlgorithm  : string
$clientAssertionSigningKey  : OpenSSLAsymmetricKey|string|null
$clientId  : string|null
$clientSecret  : string|null
$cookieDomain  : string|null
$cookieExpires  : int
$cookiePath  : string
$cookieSameSite  : string|null
$cookieSecret  : string|null
$cookieSecure  : bool
$customDomain  : string|null
$domain  : string|null
$eventDispatcher  : EventDispatcher|null
An instance of the EventDispatcher utility.
$eventListenerProvider  : ListenerProviderInterface|null
$httpClient  : ClientInterface|null
$httpMaxRetries  : int
$httpRequestFactory  : RequestFactoryInterface|null
$httpResponseFactory  : ResponseFactoryInterface|null
$httpStreamFactory  : StreamFactoryInterface|null
$httpTelemetry  : bool
$managementToken  : string|null
$managementTokenCache  : CacheItemPoolInterface|null
$organization  : array<string|int, mixed>|null
$persistAccessToken  : bool
$persistIdToken  : bool
$persistRefreshToken  : bool
$persistUser  : bool
$pushedAuthorizationRequest  : bool
$queryUserInfo  : bool
$redirectUri  : string|null
$responseMode  : string
$responseType  : string
$scope  : array<string|int, mixed>|null
$sessionStorage  : StoreInterface|null
$sessionStorageId  : string
$strategy  : string
$tokenAlgorithm  : string
$tokenCache  : CacheItemPoolInterface|null
$tokenCacheTtl  : int
$tokenJwksUri  : string|null
$tokenLeeway  : int
$tokenMaxAge  : int|null
$transientStorage  : StoreInterface|null
$transientStorageId  : string
$usePkce  : bool

Methods

__construct()  : mixed
SdkConfiguration Constructor.
defaultAudience()  : string
Get the first configured audience.
defaultOrganization()  : string|null
Get the first configured organization.
eventDispatcher()  : EventDispatcher
Get an instance of the EventDispatcher.
formatCustomDomain()  : string|null
Return the configured domain with protocol.
formatDomain()  : string
Return the configured custom or tenant domain, formatted with protocol.
formatScope()  : string
Return the configured scopes as a space-delimited string.
getAudience()  : null|array<string|int, string>
getBackchannelLogoutCache()  : CacheItemPoolInterface|null
getBackchannelLogoutExpires()  : int
getClientAssertionSigningAlgorithm()  : string
getClientAssertionSigningKey()  : OpenSSLAsymmetricKey|string|null
getClientId()  : string|null
getClientSecret()  : string|null
getCookieDomain()  : string|null
getCookieExpires()  : int
getCookiePath()  : string
getCookieSameSite()  : string|null
getCookieSecret()  : string|null
getCookieSecure()  : bool
getCustomDomain()  : string|null
getDomain()  : string|null
getEventListenerProvider()  : ListenerProviderInterface|null
getHttpClient()  : ClientInterface|null
getHttpMaxRetries()  : int
getHttpRequestFactory()  : RequestFactoryInterface|null
getHttpResponseFactory()  : ResponseFactoryInterface|null
getHttpStreamFactory()  : StreamFactoryInterface|null
getHttpTelemetry()  : bool
getManagementToken()  : string|null
getManagementTokenCache()  : CacheItemPoolInterface|null
getOrganization()  : null|array<string|int, string>
getPersistAccessToken()  : bool
getPersistIdToken()  : bool
getPersistRefreshToken()  : bool
getPersistUser()  : bool
getPushedAuthorizationRequest()  : bool
getQueryUserInfo()  : bool
getRedirectUri()  : string|null
getResponseMode()  : string
getResponseType()  : string
getScope()  : array<string|int, string>
getSessionStorage()  : StoreInterface|null
getSessionStorageId()  : string
getStrategy()  : string
getTokenAlgorithm()  : string
getTokenCache()  : CacheItemPoolInterface|null
getTokenCacheTtl()  : int
getTokenJwksUri()  : string|null
getTokenLeeway()  : int
getTokenMaxAge()  : int|null
getTransientStorage()  : StoreInterface|null
getTransientStorageId()  : string
getUsePkce()  : bool
hasAudience()  : bool
hasBackchannelLogoutCache()  : bool
hasClientAssertionSigningAlgorithm()  : bool
hasClientAssertionSigningKey()  : bool
hasClientId()  : bool
hasClientSecret()  : bool
hasCookieDomain()  : bool
hasCookieExpires()  : bool
hasCookiePath()  : bool
hasCookieSameSite()  : bool
hasCookieSecret()  : bool
hasCookieSecure()  : bool
hasCustomDomain()  : bool
hasDomain()  : bool
hasEventListenerProvider()  : bool
hasHttpClient()  : bool
hasHttpMaxRetries()  : bool
hasHttpRequestFactory()  : bool
hasHttpResponseFactory()  : bool
hasHttpStreamFactory()  : bool
hasHttpTelemetry()  : bool
hasManagementToken()  : bool
hasManagementTokenCache()  : bool
hasOrganization()  : bool
hasPersistAccessToken()  : bool
hasPersistIdToken()  : bool
hasPersistRefreshToken()  : bool
hasPersistUser()  : bool
hasQueryUserInfo()  : bool
hasRedirectUri()  : bool
hasResponseMode()  : bool
hasResponseType()  : bool
hasScope()  : bool
hasSessionStorage()  : bool
hasSessionStorageId()  : bool
hasStrategy()  : bool
hasTokenAlgorithm()  : bool
hasTokenCache()  : bool
hasTokenCacheTtl()  : bool
hasTokenJwksUri()  : bool
hasTokenLeeway()  : bool
hasTokenMaxAge()  : bool
hasTransientStorage()  : bool
hasTransientStorageId()  : bool
hasUsePkce()  : bool
pushAudience()  : null|array<string|int, string>
pushOrganization()  : null|array<string|int, string>
pushScope()  : null|array<string|int, string>
setAudience()  : self
setBackchannelLogoutCache()  : self
setBackchannelLogoutExpires()  : self
setClientAssertionSigningAlgorithm()  : self
setClientAssertionSigningKey()  : self
setClientId()  : self
setClientSecret()  : self
setCookieDomain()  : self
setCookieExpires()  : self
setCookiePath()  : self
setCookieSameSite()  : self
setCookieSecret()  : self
setCookieSecure()  : self
setCustomDomain()  : self
setDomain()  : self
setEventListenerProvider()  : self
setHttpClient()  : self
setHttpMaxRetries()  : self
setHttpRequestFactory()  : self
setHttpResponseFactory()  : self
setHttpStreamFactory()  : self
setHttpTelemetry()  : self
setManagementToken()  : self
setManagementTokenCache()  : self
setOrganization()  : self
setPersistAccessToken()  : self
setPersistIdToken()  : self
setPersistRefreshToken()  : self
setPersistUser()  : self
setPushedAuthorizationRequest()  : void
setQueryUserInfo()  : self
setRedirectUri()  : self
setResponseMode()  : self
setResponseType()  : self
setScope()  : self
setSessionStorage()  : self
setSessionStorageId()  : self
setStrategy()  : self
setTokenAlgorithm()  : self
setTokenCache()  : self
setTokenCacheTtl()  : self
setTokenJwksUri()  : self
setTokenLeeway()  : self
setTokenMaxAge()  : self
setTransientStorage()  : self
setTransientStorageId()  : self
setUsePkce()  : self
usingStatefulness()  : bool
Returns true when the configured `strategy` is 'stateful', meaning it requires an available and configured session.
applyConfiguration()  : self
exceptionIfNull()  : void
filterArray()  : null|array<string|int, string>
filterArrayMixed()  : null|array<string|int, mixed>
filterDomain()  : string|null
filterString()  : string
getPropertyDefaults()  : array{strategy: string, domain: null, customDomain: null, clientId: null, redirectUri: null, clientSecret: null, audience: null, organization: null, usePkce: true, scope: string[], responseMode: string, responseType: string, tokenAlgorithm: string, tokenJwksUri: null, tokenMaxAge: null, tokenLeeway: int, tokenCache: null, tokenCacheTtl: int, httpClient: null, httpMaxRetries: int, httpRequestFactory: null, httpResponseFactory: null, httpStreamFactory: null, httpTelemetry: true, sessionStorage: null, sessionStorageId: string, cookieSecret: null, cookieDomain: null, cookieExpires: int, cookiePath: string, cookieSecure: false, cookieSameSite: null, persistUser: true, persistIdToken: true, persistAccessToken: true, persistRefreshToken: true, transientStorage: null, transientStorageId: string, queryUserInfo: false, managementToken: null, managementTokenCache: null, eventListenerProvider: null, clientAssertionSigningKey: null, clientAssertionSigningAlgorithm: string, pushedAuthorizationRequest: bool, backchannelLogoutCache: null, backchannelLogoutExpires: int}
getPropertyValidators()  : array<string|int, callable>
setupStateFactories()  : void
Setup SDK factories.
setupStateStorage()  : void
Setup SDK storage state.
validateProperties()  : void
validateState()  : void
Setup SDK validators based on strategy type.
validateStateApi()  : void
Run validations for an API-only usage configuration.
validateStateManagement()  : void
Run validations for a Management-only usage configuration.
validateStateWebApp()  : void
Run validations for a general webapp usage configuration.

Constants

STRATEGIES_USING_SESSIONS

public array<string|int, string> STRATEGIES_USING_SESSIONS = [self::STRATEGY_REGULAR]

STRATEGY_MANAGEMENT_API

public string STRATEGY_MANAGEMENT_API = 'management'

Properties

$backchannelLogoutCache

private CacheItemPoolInterface|null $backchannelLogoutCache = null

$backchannelLogoutExpires

private int $backchannelLogoutExpires = 2592000

$clientAssertionSigningAlgorithm

private string $clientAssertionSigningAlgorithm = Token::ALGO_RS256

$clientAssertionSigningKey

private OpenSSLAsymmetricKey|string|null $clientAssertionSigningKey = null

$eventListenerProvider

private ListenerProviderInterface|null $eventListenerProvider = null

$httpRequestFactory

private RequestFactoryInterface|null $httpRequestFactory = null

$httpResponseFactory

private ResponseFactoryInterface|null $httpResponseFactory = null

$httpStreamFactory

private StreamFactoryInterface|null $httpStreamFactory = null

$managementTokenCache

private CacheItemPoolInterface|null $managementTokenCache = null

$organization

private array<string|int, mixed>|null $organization = null

$pushedAuthorizationRequest

private bool $pushedAuthorizationRequest = false

$scope

private array<string|int, mixed>|null $scope = ['openid', 'profile', 'email']

$transientStorageId

private string $transientStorageId = 'auth0_transient'

Methods

__construct()

SdkConfiguration Constructor.

public __construct([null|array<string|int, mixed> $configuration = null ][, string $strategy = self::STRATEGY_REGULAR ][, null|string $domain = null ][, null|string $customDomain = null ][, null|string $clientId = null ][, null|string $redirectUri = null ][, null|string $clientSecret = null ][, null|array<string|int, string> $audience = null ][, null|array<string|int, string> $organization = null ][, bool $usePkce = true ][, null|array<string|int, string> $scope = ['openid', 'profile', 'email'] ][, string $responseMode = 'query' ][, string $responseType = 'code' ][, string $tokenAlgorithm = Token::ALGO_RS256 ][, null|string $tokenJwksUri = null ][, null|int $tokenMaxAge = null ][, int $tokenLeeway = 60 ][, null|CacheItemPoolInterface $tokenCache = null ][, int $tokenCacheTtl = 60 ][, null|ClientInterface $httpClient = null ][, int $httpMaxRetries = 3 ][, null|RequestFactoryInterface $httpRequestFactory = null ][, null|ResponseFactoryInterface $httpResponseFactory = null ][, null|StreamFactoryInterface $httpStreamFactory = null ][, bool $httpTelemetry = true ][, null|StoreInterface $sessionStorage = null ][, string $sessionStorageId = 'auth0_session' ][, null|string $cookieSecret = null ][, null|string $cookieDomain = null ][, int $cookieExpires = 0 ][, string $cookiePath = '/' ][, bool $cookieSecure = false ][, null|string $cookieSameSite = null ][, bool $persistUser = true ][, bool $persistIdToken = true ][, bool $persistAccessToken = true ][, bool $persistRefreshToken = true ][, null|StoreInterface $transientStorage = null ][, string $transientStorageId = 'auth0_transient' ][, bool $queryUserInfo = false ][, null|string $managementToken = null ][, null|CacheItemPoolInterface $managementTokenCache = null ][, null|ListenerProviderInterface $eventListenerProvider = null ][, null|OpenSSLAsymmetricKey|string $clientAssertionSigningKey = null ][, string $clientAssertionSigningAlgorithm = Token::ALGO_RS256 ][, bool $pushedAuthorizationRequest = false ][, null|CacheItemPoolInterface $backchannelLogoutCache = null ][, int $backchannelLogoutExpires = 2592000 ]) : mixed
Parameters
$configuration : null|array<string|int, mixed> = null

An key-value array matching this constructor's arguments. Overrides any other passed arguments with the same key name.

$strategy : string = self::STRATEGY_REGULAR

Defaults to 'webapp'. Should be assigned either 'api', 'management', or 'webapp' to specify the type of application the SDK is being applied to. Determines what configuration options will be required at initialization.

$domain : null|string = null

Auth0 domain for your tenant, found in your Auth0 Application settings

$customDomain : null|string = null

If you have configured Auth0 to use a custom domain, configure it here

$clientId : null|string = null

Client ID, found in the Auth0 Application settings

$redirectUri : null|string = null

Authentication callback URI, as defined in your Auth0 Application settings

$clientSecret : null|string = null

Client Secret, found in the Auth0 Application settings

$audience : null|array<string|int, string> = null

One or more API identifiers, found in your Auth0 API settings. The SDK uses the first value for building links. If provided, at least one of these values must match the 'aud' claim to validate an ID Token successfully.

$organization : null|array<string|int, string> = null

Allowlist containing one or more organization IDs/names. Reference your Auth0 organization settings for these values. By default, the SDK will use the first value provided when generating authorization links.

$usePkce : bool = true

Defaults to true. Use PKCE (Proof Key of Code Exchange) with Authorization Code Flow requests. See https://auth0.com/docs/flows/call-your-api-using-the-authorization-code-flow-with-pkce

$scope : null|array<string|int, string> = ['openid', 'profile', 'email']

One or more scopes to request for Tokens. See https://auth0.com/docs/scopes

$responseMode : string = 'query'

Defaults to 'query.' Where to extract request parameters from, either 'query' for GET or 'form_post' for POST requests.

$responseType : string = 'code'

Defaults to 'code.' Use 'code' for server-side flows and 'token' for application side flow.

$tokenAlgorithm : string = Token::ALGO_RS256

Defaults to 'RS256'. Algorithm to use for Token verification. Expects either 'RS256' or 'HS256'.

$tokenJwksUri : null|string = null

URI to the JWKS when verifying RS256 tokens

$tokenMaxAge : null|int = null

The maximum window of time (in seconds) since the 'auth_time' to accept during Token validation

$tokenLeeway : int = 60

Defaults to 60. Leeway (in seconds) to allow during time calculations with Token validation.

$tokenCache : null|CacheItemPoolInterface = null

A PSR-6 compatible cache adapter for storing JSON Web Key Sets (JWKS)

$tokenCacheTtl : int = 60

How long (in seconds) to keep a JWKS cached

$httpClient : null|ClientInterface = null

A PSR-18 compatible HTTP client to use for API requests

$httpMaxRetries : int = 3

When a rate-limit (429 status code) response is returned from the Auth0 API, automatically retry the request up to this many times

$httpRequestFactory : null|RequestFactoryInterface = null

A PSR-17 compatible request factory to generate HTTP requests

$httpResponseFactory : null|ResponseFactoryInterface = null

A PSR-17 compatible response factory to generate HTTP responses

$httpStreamFactory : null|StreamFactoryInterface = null

A PSR-17 compatible stream factory to create request body streams

$httpTelemetry : bool = true

Defaults to true. If true, API requests will include telemetry about the SDK and PHP runtime version to help us improve our services.

$sessionStorage : null|StoreInterface = null

Defaults to use cookies. A StoreInterface-compatible class for storing Token state.

$sessionStorageId : string = 'auth0_session'

Defaults to 'auth0_session'. The namespace to prefix session items under.

$cookieSecret : null|string = null

The secret used to derive an encryption key (via HKDF-SHA256) for the user identity in a session cookie and to sign the transient cookies used by the login callback. Should be at least 32 bytes.

$cookieDomain : null|string = null

Defaults to value of HTTP_HOST server environment information. Cookie domain, for example 'www.example.com', for use with PHP sessions and SDK cookies. To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.example.com'.

$cookieExpires : int = 0

Defaults to 0. How long, in seconds, before cookies expire. If set to 0 the cookie will expire at the end of the session (when the browser closes).

$cookiePath : string = '/'

Defaults to '/'. Specifies path on the domain where the cookies will work. Use a single slash ('/') for all paths on the domain.

$cookieSecure : bool = false

Defaults to false. Specifies whether cookies should ONLY be sent over secure connections.

$cookieSameSite : null|string = null

Defaults to 'lax'. Specifies whether cookies should be restricted to first-party or same-site context.

$persistUser : bool = true

Defaults to true. If true, the user data will persist in session storage.

$persistIdToken : bool = true

Defaults to true. If true, the Id Token will persist in session storage.

$persistAccessToken : bool = true

Defaults to true. If true, the Access Token will persist in session storage.

$persistRefreshToken : bool = true

Defaults to true. If true, the Refresh Token will persist in session storage.

$transientStorage : null|StoreInterface = null

Defaults to use cookies. A StoreInterface-compatible class for storing ephemeral state data, such as nonces.

$transientStorageId : string = 'auth0_transient'

Defaults to 'auth0_transient'. The namespace to prefix transient items under.

$queryUserInfo : bool = false

Defaults to false. If true, query the /userinfo endpoint during an authorization code exchange.

$managementToken : null|string = null

An Access Token to use for Management API calls. If there isn't one specified, the SDK will attempt to get one for you using your $clientSecret.

$managementTokenCache : null|CacheItemPoolInterface = null

A PSR-6 compatible cache adapter for storing generated management access tokens

$eventListenerProvider : null|ListenerProviderInterface = null

A PSR-14 compatible event listener provider, for interfacing with events triggered by the SDK

$clientAssertionSigningKey : null|OpenSSLAsymmetricKey|string = null

An OpenSSLAsymmetricKey (or string representing equivalent, such as a PEM) to use for signing the client assertion. If not specified, the SDK will attempt to use the $clientSecret.

$clientAssertionSigningAlgorithm : string = Token::ALGO_RS256

Defaults to RS256. Algorithm to use for signing the client assertion.

$pushedAuthorizationRequest : bool = false

Defaults to false. If true, the SDK will attempt to use the Pushed Authorization Requests for authentication. See https://www.rfc-editor.org/rfc/rfc9126.html#.

$backchannelLogoutCache : null|CacheItemPoolInterface = null

A PSR-6 compatible cache adapter for storing backchannel logout tokens.

$backchannelLogoutExpires : int = 2592000

Defaults to 2592000 (30 days). How long, in seconds, before a backchannel logout request expires from the cache. This should be greater than your $cookieExpires value, particularly if you are using rolling sessions.

Tags
throws
ConfigurationException

when a valid $strategy is not specified

defaultAudience()

Get the first configured audience.

public defaultAudience() : string
Return values
string

defaultOrganization()

Get the first configured organization.

public defaultOrganization() : string|null
Return values
string|null

formatCustomDomain()

Return the configured domain with protocol.

public formatCustomDomain() : string|null
Return values
string|null

formatDomain()

Return the configured custom or tenant domain, formatted with protocol.

public formatDomain([bool $forceTenantDomain = false ]) : string
Parameters
$forceTenantDomain : bool = false

force the return of the tenant domain even if a custom domain is configured

Return values
string

formatScope()

Return the configured scopes as a space-delimited string.

public formatScope() : string
Return values
string

getAudience()

public getAudience([Throwable|null $exceptionIfNull = null ]) : null|array<string|int, string>
Parameters
$exceptionIfNull : Throwable|null = null
Return values
null|array<string|int, string>

getBackchannelLogoutCache()

public getBackchannelLogoutCache([Throwable|null $exceptionIfNull = null ]) : CacheItemPoolInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
CacheItemPoolInterface|null

getBackchannelLogoutExpires()

public getBackchannelLogoutExpires() : int
Return values
int

getClientAssertionSigningAlgorithm()

public getClientAssertionSigningAlgorithm() : string
Return values
string

getClientAssertionSigningKey()

public getClientAssertionSigningKey() : OpenSSLAsymmetricKey|string|null
Return values
OpenSSLAsymmetricKey|string|null

getClientId()

public getClientId([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getClientSecret()

public getClientSecret([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getCookieDomain()

public getCookieDomain() : string|null
Return values
string|null

getCookieSameSite()

public getCookieSameSite([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getCookieSecret()

public getCookieSecret([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getCustomDomain()

public getCustomDomain([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getDomain()

public getDomain([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getEventListenerProvider()

public getEventListenerProvider([Throwable|null $exceptionIfNull = null ]) : ListenerProviderInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
ListenerProviderInterface|null

getHttpClient()

public getHttpClient([Throwable|null $exceptionIfNull = null ]) : ClientInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
ClientInterface|null

getHttpRequestFactory()

public getHttpRequestFactory([Throwable|null $exceptionIfNull = null ]) : RequestFactoryInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
RequestFactoryInterface|null

getHttpResponseFactory()

public getHttpResponseFactory([Throwable|null $exceptionIfNull = null ]) : ResponseFactoryInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
ResponseFactoryInterface|null

getHttpStreamFactory()

public getHttpStreamFactory([Throwable|null $exceptionIfNull = null ]) : StreamFactoryInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
StreamFactoryInterface|null

getManagementToken()

public getManagementToken([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getManagementTokenCache()

public getManagementTokenCache([Throwable|null $exceptionIfNull = null ]) : CacheItemPoolInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
CacheItemPoolInterface|null

getOrganization()

public getOrganization([Throwable|null $exceptionIfNull = null ]) : null|array<string|int, string>
Parameters
$exceptionIfNull : Throwable|null = null
Return values
null|array<string|int, string>

The configured allowlist of organization IDs/names.

getPersistAccessToken()

public getPersistAccessToken() : bool
Return values
bool

getPersistIdToken()

public getPersistIdToken() : bool
Return values
bool

getPersistRefreshToken()

public getPersistRefreshToken() : bool
Return values
bool

getPushedAuthorizationRequest()

public getPushedAuthorizationRequest() : bool
Return values
bool

getRedirectUri()

public getRedirectUri([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getResponseMode()

public getResponseMode() : string
Return values
string

getResponseType()

public getResponseType() : string
Return values
string

getScope()

public getScope() : array<string|int, string>
Return values
array<string|int, string>

the array of scopes that will be requested during authentication steps

getSessionStorageId()

public getSessionStorageId() : string
Return values
string

getTokenAlgorithm()

public getTokenAlgorithm() : string
Return values
string

getTokenCache()

public getTokenCache([Throwable|null $exceptionIfNull = null ]) : CacheItemPoolInterface|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
CacheItemPoolInterface|null

getTokenJwksUri()

public getTokenJwksUri([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
string|null

getTokenLeeway()

public getTokenLeeway([Throwable|null $exceptionIfNull = null ]) : int
Parameters
$exceptionIfNull : Throwable|null = null
Return values
int

getTokenMaxAge()

public getTokenMaxAge([Throwable|null $exceptionIfNull = null ]) : int|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
int|null

getTransientStorageId()

public getTransientStorageId() : string
Return values
string

hasBackchannelLogoutCache()

public hasBackchannelLogoutCache() : bool
Return values
bool

hasClientAssertionSigningAlgorithm()

public hasClientAssertionSigningAlgorithm() : bool
Return values
bool

hasClientAssertionSigningKey()

public hasClientAssertionSigningKey() : bool
Return values
bool

hasCookieSameSite()

public hasCookieSameSite() : bool
Return values
bool

hasEventListenerProvider()

public hasEventListenerProvider() : bool
Return values
bool

hasHttpMaxRetries()

public hasHttpMaxRetries() : bool
Return values
bool

hasHttpRequestFactory()

public hasHttpRequestFactory() : bool
Return values
bool

hasHttpResponseFactory()

public hasHttpResponseFactory() : bool
Return values
bool

hasHttpStreamFactory()

public hasHttpStreamFactory() : bool
Return values
bool

hasManagementToken()

public hasManagementToken() : bool
Return values
bool

hasManagementTokenCache()

public hasManagementTokenCache() : bool
Return values
bool

hasPersistAccessToken()

public hasPersistAccessToken() : bool
Return values
bool

hasPersistIdToken()

public hasPersistIdToken() : bool
Return values
bool

hasPersistRefreshToken()

public hasPersistRefreshToken() : bool
Return values
bool

hasSessionStorage()

public hasSessionStorage() : bool
Return values
bool

hasSessionStorageId()

public hasSessionStorageId() : bool
Return values
bool

hasTokenAlgorithm()

public hasTokenAlgorithm() : bool
Return values
bool

hasTransientStorage()

public hasTransientStorage() : bool
Return values
bool

hasTransientStorageId()

public hasTransientStorageId() : bool
Return values
bool

pushAudience()

public pushAudience(array<string|int, string>|string $audiences) : null|array<string|int, string>
Parameters
$audiences : array<string|int, string>|string

a string or array of strings to add to the API identifiers/audiences allowlist

Return values
null|array<string|int, string>

the updated allowlist

pushOrganization()

public pushOrganization(array<string|int, string>|string $organizations) : null|array<string|int, string>
Parameters
$organizations : array<string|int, string>|string

A string or array of strings representing organization IDs/names to add to the organization allowlist.

Return values
null|array<string|int, string>

pushScope()

public pushScope(array<string|int, string>|string $scopes) : null|array<string|int, string>
Parameters
$scopes : array<string|int, string>|string

one or more scopes to add to the list requested during authentication steps

Return values
null|array<string|int, string>

setAudience()

public setAudience([null|array<string|int, string> $audience = null ]) : self
Parameters
$audience : null|array<string|int, string> = null

an allowlist array of API identifiers/audiences

Return values
self

setBackchannelLogoutCache()

public setBackchannelLogoutCache([CacheItemPoolInterface|null $backchannelLogoutCache = null ]) : self
Parameters
$backchannelLogoutCache : CacheItemPoolInterface|null = null
Return values
self

setBackchannelLogoutExpires()

public setBackchannelLogoutExpires([int $backchannelLogoutExpires = 2592000 ]) : self
Parameters
$backchannelLogoutExpires : int = 2592000
Return values
self

setClientAssertionSigningAlgorithm()

public setClientAssertionSigningAlgorithm([string $clientAssertionSigningAlgorithm = Token::ALGO_RS256 ]) : self
Parameters
$clientAssertionSigningAlgorithm : string = Token::ALGO_RS256
Return values
self

setClientAssertionSigningKey()

public setClientAssertionSigningKey(OpenSSLAsymmetricKey|string|null $clientAssertionSigningKey) : self
Parameters
$clientAssertionSigningKey : OpenSSLAsymmetricKey|string|null
Return values
self

setClientId()

public setClientId([string|null $clientId = null ]) : self
Parameters
$clientId : string|null = null
Return values
self

setClientSecret()

public setClientSecret([string|null $clientSecret = null ]) : self
Parameters
$clientSecret : string|null = null
Return values
self

setCookieDomain()

public setCookieDomain([string|null $cookieDomain = null ]) : self
Parameters
$cookieDomain : string|null = null
Return values
self

setCookieExpires()

public setCookieExpires([int $cookieExpires = 0 ]) : self
Parameters
$cookieExpires : int = 0
Return values
self

setCookiePath()

public setCookiePath([string $cookiePath = '/' ]) : self
Parameters
$cookiePath : string = '/'
Return values
self

setCookieSameSite()

public setCookieSameSite([string|null $cookieSameSite = null ]) : self
Parameters
$cookieSameSite : string|null = null
Return values
self

setCookieSecret()

public setCookieSecret([string|null $cookieSecret = null ]) : self
Parameters
$cookieSecret : string|null = null
Return values
self

setCookieSecure()

public setCookieSecure([bool $cookieSecure = false ]) : self
Parameters
$cookieSecure : bool = false
Return values
self

setCustomDomain()

public setCustomDomain([string|null $customDomain = null ]) : self
Parameters
$customDomain : string|null = null
Return values
self

setDomain()

public setDomain([string|null $domain = null ]) : self
Parameters
$domain : string|null = null
Return values
self

setEventListenerProvider()

public setEventListenerProvider([ListenerProviderInterface|null $eventListenerProvider = null ]) : self
Parameters
$eventListenerProvider : ListenerProviderInterface|null = null
Return values
self

setHttpClient()

public setHttpClient([ClientInterface|null $httpClient = null ]) : self
Parameters
$httpClient : ClientInterface|null = null
Return values
self

setHttpMaxRetries()

public setHttpMaxRetries([int $httpMaxRetries = 3 ]) : self
Parameters
$httpMaxRetries : int = 3
Return values
self

setHttpRequestFactory()

public setHttpRequestFactory([RequestFactoryInterface|null $httpRequestFactory = null ]) : self
Parameters
$httpRequestFactory : RequestFactoryInterface|null = null
Return values
self

setHttpResponseFactory()

public setHttpResponseFactory([ResponseFactoryInterface|null $httpResponseFactory = null ]) : self
Parameters
$httpResponseFactory : ResponseFactoryInterface|null = null
Return values
self

setHttpStreamFactory()

public setHttpStreamFactory([StreamFactoryInterface|null $httpStreamFactory = null ]) : self
Parameters
$httpStreamFactory : StreamFactoryInterface|null = null
Return values
self

setHttpTelemetry()

public setHttpTelemetry([bool $httpTelemetry = true ]) : self
Parameters
$httpTelemetry : bool = true
Return values
self

setManagementToken()

public setManagementToken([string|null $managementToken = null ]) : self
Parameters
$managementToken : string|null = null
Return values
self

setManagementTokenCache()

public setManagementTokenCache([CacheItemPoolInterface|null $managementTokenCache = null ]) : self
Parameters
$managementTokenCache : CacheItemPoolInterface|null = null
Return values
self

setOrganization()

public setOrganization([null|array<string|int, string> $organization = null ]) : self
Parameters
$organization : null|array<string|int, string> = null

An allowlist of organizations IDs/names.

Return values
self

setPersistAccessToken()

public setPersistAccessToken([bool $persistAccessToken = true ]) : self
Parameters
$persistAccessToken : bool = true
Return values
self

setPersistIdToken()

public setPersistIdToken([bool $persistIdToken = true ]) : self
Parameters
$persistIdToken : bool = true
Return values
self

setPersistRefreshToken()

public setPersistRefreshToken([bool $persistRefreshToken = true ]) : self
Parameters
$persistRefreshToken : bool = true
Return values
self

setPersistUser()

public setPersistUser([bool $persistUser = true ]) : self
Parameters
$persistUser : bool = true
Return values
self

setPushedAuthorizationRequest()

public setPushedAuthorizationRequest(bool $pushedAuthorizationRequest) : void
Parameters
$pushedAuthorizationRequest : bool

setQueryUserInfo()

public setQueryUserInfo([bool $queryUserInfo = false ]) : self
Parameters
$queryUserInfo : bool = false
Return values
self

setRedirectUri()

public setRedirectUri([string|null $redirectUri = null ]) : self
Parameters
$redirectUri : string|null = null
Return values
self

setResponseMode()

public setResponseMode([string $responseMode = 'query' ]) : self
Parameters
$responseMode : string = 'query'
Return values
self

setResponseType()

public setResponseType([string $responseType = 'code' ]) : self
Parameters
$responseType : string = 'code'
Return values
self

setScope()

public setScope([null|array<string|int, string> $scope = ['openid', 'profile', 'email'] ]) : self
Parameters
$scope : null|array<string|int, string> = ['openid', 'profile', 'email']

an array of scopes to request during authentication steps

Return values
self

setSessionStorageId()

public setSessionStorageId([string $sessionStorageId = 'auth0_session' ]) : self
Parameters
$sessionStorageId : string = 'auth0_session'
Return values
self

setStrategy()

public setStrategy([string $strategy = self::STRATEGY_REGULAR ]) : self
Parameters
$strategy : string = self::STRATEGY_REGULAR
Return values
self

setTokenCache()

public setTokenCache([CacheItemPoolInterface|null $tokenCache = null ]) : self
Parameters
$tokenCache : CacheItemPoolInterface|null = null
Return values
self

setTokenCacheTtl()

public setTokenCacheTtl([int $tokenCacheTtl = 60 ]) : self
Parameters
$tokenCacheTtl : int = 60
Return values
self

setTokenJwksUri()

public setTokenJwksUri([string|null $tokenJwksUri = null ]) : self
Parameters
$tokenJwksUri : string|null = null
Return values
self

setTokenLeeway()

public setTokenLeeway([int $tokenLeeway = 60 ]) : self
Parameters
$tokenLeeway : int = 60
Return values
self

setTokenMaxAge()

public setTokenMaxAge([int|null $tokenMaxAge = null ]) : self
Parameters
$tokenMaxAge : int|null = null
Return values
self

setTransientStorageId()

public setTransientStorageId([string $transientStorageId = 'auth0_transient' ]) : self
Parameters
$transientStorageId : string = 'auth0_transient'
Return values
self

setUsePkce()

public setUsePkce(bool $usePkce) : self
Parameters
$usePkce : bool
Return values
self

usingStatefulness()

Returns true when the configured `strategy` is 'stateful', meaning it requires an available and configured session.

public usingStatefulness() : bool
Return values
bool

applyConfiguration()

private applyConfiguration(null|array<string|int, mixed> $configuration) : self
Parameters
$configuration : null|array<string|int, mixed>
Tags
psalm-suppress

MissingClosureParamType,MissingClosureReturnType

Return values
self

exceptionIfNull()

private exceptionIfNull(mixed $value[, null|Throwable $throwable = null ]) : void
Parameters
$value : mixed

a value to compare against NULL

$throwable : null|Throwable = null

Optional. A Throwable exception to raise if $value is NULL.

filterArray()

private filterArray(null|array<string|int, string> $filtering[, bool $keepKeys = false ]) : null|array<string|int, string>
Parameters
$filtering : null|array<string|int, string>

an array of strings to filter, or NULL

$keepKeys : bool = false

Optional. Whether to keep array keys or reindex the array appropriately.

Tags
psalm-suppress

DocblockTypeContradiction,RedundantCastGivenDocblockType

Return values
null|array<string|int, string>

filterArrayMixed()

private filterArrayMixed(null|array<string|int, mixed> $filtering[, bool $keepKeys = false ]) : null|array<string|int, mixed>
Parameters
$filtering : null|array<string|int, mixed>

an array to filter, or NULL

$keepKeys : bool = false

Optional. Whether to keep array keys or reindex the array appropriately.

Return values
null|array<string|int, mixed>

filterDomain()

private filterDomain(string $domain) : string|null
Parameters
$domain : string
Return values
string|null

filterString()

private filterString(string $string) : string
Parameters
$string : string

A string to apply sanitization filtering to.

Tags
psalm-suppress

UnusedFunctionCall

Return values
string

getPropertyDefaults()

private getPropertyDefaults() : array{strategy: string, domain: null, customDomain: null, clientId: null, redirectUri: null, clientSecret: null, audience: null, organization: null, usePkce: true, scope: string[], responseMode: string, responseType: string, tokenAlgorithm: string, tokenJwksUri: null, tokenMaxAge: null, tokenLeeway: int, tokenCache: null, tokenCacheTtl: int, httpClient: null, httpMaxRetries: int, httpRequestFactory: null, httpResponseFactory: null, httpStreamFactory: null, httpTelemetry: true, sessionStorage: null, sessionStorageId: string, cookieSecret: null, cookieDomain: null, cookieExpires: int, cookiePath: string, cookieSecure: false, cookieSameSite: null, persistUser: true, persistIdToken: true, persistAccessToken: true, persistRefreshToken: true, transientStorage: null, transientStorageId: string, queryUserInfo: false, managementToken: null, managementTokenCache: null, eventListenerProvider: null, clientAssertionSigningKey: null, clientAssertionSigningAlgorithm: string, pushedAuthorizationRequest: bool, backchannelLogoutCache: null, backchannelLogoutExpires: int}
Return values
array{strategy: string, domain: null, customDomain: null, clientId: null, redirectUri: null, clientSecret: null, audience: null, organization: null, usePkce: true, scope: string[], responseMode: string, responseType: string, tokenAlgorithm: string, tokenJwksUri: null, tokenMaxAge: null, tokenLeeway: int, tokenCache: null, tokenCacheTtl: int, httpClient: null, httpMaxRetries: int, httpRequestFactory: null, httpResponseFactory: null, httpStreamFactory: null, httpTelemetry: true, sessionStorage: null, sessionStorageId: string, cookieSecret: null, cookieDomain: null, cookieExpires: int, cookiePath: string, cookieSecure: false, cookieSameSite: null, persistUser: true, persistIdToken: true, persistAccessToken: true, persistRefreshToken: true, transientStorage: null, transientStorageId: string, queryUserInfo: false, managementToken: null, managementTokenCache: null, eventListenerProvider: null, clientAssertionSigningKey: null, clientAssertionSigningAlgorithm: string, pushedAuthorizationRequest: bool, backchannelLogoutCache: null, backchannelLogoutExpires: int}

getPropertyValidators()

private getPropertyValidators() : array<string|int, callable>
Tags
psalm-suppress

MissingClosureParamType

Return values
array<string|int, callable>

setupStateFactories()

Setup SDK factories.

private setupStateFactories() : void
Tags
codeCoverageIgnore

setupStateStorage()

Setup SDK storage state.

private setupStateStorage() : void

validateProperties()

private validateProperties() : void
Tags
psalm-suppress

MissingClosureParamType,MissingClosureReturnType

validateState()

Setup SDK validators based on strategy type.

private validateState([string|null $strategy = null ]) : void
Parameters
$strategy : string|null = null

validateStateApi()

Run validations for an API-only usage configuration.

private validateStateApi() : void

validateStateManagement()

Run validations for a Management-only usage configuration.

private validateStateManagement() : void

validateStateWebApp()

Run validations for a general webapp usage configuration.

private validateStateWebApp() : void
On this page

Search results