Auth0-PHP

SdkConfiguration
in package
implements ConfigurableContract Uses ConfigurableMixin

Configuration container for use with Auth0\SDK.

Interfaces, Classes, Traits and Enums

ConfigurableContract

Table of Contents

STRATEGIES_USING_SESSIONS  = [self::STRATEGY_REGULAR]
STRATEGY_API  = 'api'
STRATEGY_MANAGEMENT_API  = 'management'
STRATEGY_NONE  = 'none'
STRATEGY_REGULAR  = 'webapp'
$audience  : array<string|int, mixed>|null
$clientId  : string|null
$clientSecret  : string|null
$configuration  : array<string|int, mixed>|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
$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
__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|null
Return the configured scopes as a space-delimited string.
getAudience()  : array<string|int, 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()  : array<string|int, string>|null
getPersistAccessToken()  : bool
getPersistIdToken()  : bool
getPersistRefreshToken()  : bool
getPersistUser()  : 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|null
getTokenMaxAge()  : int|null
getTransientStorage()  : StoreInterface|null
getTransientStorageId()  : string
getUsePkce()  : bool
hasAudience()  : 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()  : array<string|int, string>|null
pushOrganization()  : array<string|int, string>|null
pushScope()  : array<string|int, string>|null
setAudience()  : 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
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()  : array<string|int, string>|null
filterArrayMixed()  : array<string|int, mixed>|null
filterDomain()  : string|null
filterHtml()  : string
filterString()  : string
filterStringTags()  : string
filterStringUtf8()  : string
getPropertyDefaults()  : array<string|int, mixed>
getPropertyValidators()  : array<string|int, callable>
setupStateCookies()  : void
Setup SDK cookie state.
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 mixed STRATEGIES_USING_SESSIONS = [self::STRATEGY_REGULAR]

STRATEGY_MANAGEMENT_API

public mixed STRATEGY_MANAGEMENT_API = 'management'

Properties

$configuration

private array<string|int, mixed>|null $configuration = 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

$scope

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

$transientStorageId

private string $transientStorageId = 'auth0_transient'

Methods

__construct()

SdkConfiguration Constructor.

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

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

$customDomain : string|null = null

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

$clientId : string|null = null

client ID, found in the Auth0 Application settings

$redirectUri : string|null = null

authentication callback URI, as defined in your Auth0 Application settings

$clientSecret : string|null = null

client Secret, found in the Auth0 Application settings

$audience : array<string|int, string>|null = 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 : array<string|int, string>|null = null

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

$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 : array<string|int, string>|null = ['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 : string|null = null

URI to the JWKS when verifying RS256 tokens

$tokenMaxAge : int|null = 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 : CacheItemPoolInterface|null = 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 : ClientInterface|null = 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 : RequestFactoryInterface|null = null

a PSR-17 compatible request factory to generate HTTP requests

$httpResponseFactory : ResponseFactoryInterface|null = null

a PSR-17 compatible response factory to generate HTTP responses

$httpStreamFactory : StreamFactoryInterface|null = 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 : StoreInterface|null = 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 : string|null = null

the secret used to derive an encryption key for the user identity in a session cookie and to sign the transient cookies used by the login callback

$cookieDomain : string|null = 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

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 : string|null = 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 : StoreInterface|null = 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 : string|null = 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 : CacheItemPoolInterface|null = null

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

$eventListenerProvider : ListenerProviderInterface|null = null

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

Tags
throws
ConfigurationException

when a valid $strategy is not specified

Return values
mixed

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|null
Return values
string|null

getAudience()

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

getCookieExpires()

public getCookieExpires() : int
Return values
int

getCookiePath()

public getCookiePath() : string
Return values
string

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

getCookieSecure()

public getCookieSecure() : bool
Return values
bool

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

getHttpMaxRetries()

public getHttpMaxRetries() : int
Return values
int

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

getHttpTelemetry()

public getHttpTelemetry() : bool
Return values
bool

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 ]) : array<string|int, string>|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
array<string|int, string>|null

the allowlist of Organization IDs

getPersistAccessToken()

public getPersistAccessToken() : bool
Return values
bool

getPersistIdToken()

public getPersistIdToken() : bool
Return values
bool

getPersistRefreshToken()

public getPersistRefreshToken() : bool
Return values
bool

getQueryUserInfo()

public getQueryUserInfo() : 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

getTokenCacheTtl()

public getTokenCacheTtl() : int
Return values
int

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|null
Parameters
$exceptionIfNull : Throwable|null = null
Return values
int|null

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

hasClientSecret()

public hasClientSecret() : bool
Return values
bool

hasCookieDomain()

public hasCookieDomain() : bool
Return values
bool

hasCookieExpires()

public hasCookieExpires() : bool
Return values
bool

hasCookieSameSite()

public hasCookieSameSite() : bool
Return values
bool

hasCookieSecret()

public hasCookieSecret() : bool
Return values
bool

hasCookieSecure()

public hasCookieSecure() : bool
Return values
bool

hasCustomDomain()

public hasCustomDomain() : 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

hasHttpTelemetry()

public hasHttpTelemetry() : bool
Return values
bool

hasManagementToken()

public hasManagementToken() : bool
Return values
bool

hasManagementTokenCache()

public hasManagementTokenCache() : bool
Return values
bool

hasOrganization()

public hasOrganization() : 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

hasQueryUserInfo()

public hasQueryUserInfo() : bool
Return values
bool

hasResponseMode()

public hasResponseMode() : bool
Return values
bool

hasResponseType()

public hasResponseType() : 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

hasTokenCacheTtl()

public hasTokenCacheTtl() : bool
Return values
bool

hasTokenJwksUri()

public hasTokenJwksUri() : bool
Return values
bool

hasTokenLeeway()

public hasTokenLeeway() : bool
Return values
bool

hasTokenMaxAge()

public hasTokenMaxAge() : 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) : array<string|int, string>|null
Parameters
$audiences : array<string|int, string>|string

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

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

the updated allowlist

pushOrganization()

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

a string or array of strings representing Organization IDs to add to the allowlist

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

pushScope()

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

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

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

setAudience()

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

an allowlist array of API identifiers/audiences

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) : self
Parameters
$cookieExpires : int
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([array<string|int, string>|null $organization = null ]) : self
Parameters
$organization : array<string|int, string>|null = null

an allowlist of Organization IDs

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

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([array<string|int, string> $scope = ['openid', 'profile', 'email'] ]) : self
Parameters
$scope : 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

setTokenAlgorithm()

public setTokenAlgorithm([string $tokenAlgorithm = Token::ALGO_RS256 ]) : self
Parameters
$tokenAlgorithm : string = Token::ALGO_RS256
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(array<string|int, mixed>|null $configuration) : self
Parameters
$configuration : array<string|int, mixed>|null
Tags
psalm-suppress

MissingClosureParamType,MissingClosureReturnType

Return values
self

exceptionIfNull()

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

a value to compare against NULL

$throwable : Throwable|null = null

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

Return values
void

filterArray()

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

an array of strings to filter, or NULL

$keepKeys : bool = false

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

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

filterArrayMixed()

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

an array to filter, or NULL

$keepKeys : bool = false

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

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

filterDomain()

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

filterHtml()

private filterHtml(string $str[, int $flags = ENT_QUOTES | ENT_SUBSTITUTE ]) : string
Parameters
$str : string
$flags : int = ENT_QUOTES | ENT_SUBSTITUTE
Return values
string

filterString()

private filterString(string $str[, bool $allowLineBreaks = false ]) : string
Parameters
$str : string
$allowLineBreaks : bool = false
Return values
string

filterStringTags()

private filterStringTags(string $str[, bool $allowLineBreaks = false ]) : string
Parameters
$str : string
$allowLineBreaks : bool = false
Return values
string

filterStringUtf8()

private filterStringUtf8(string $str[, bool $strip = false ]) : string
Parameters
$str : string
$strip : bool = false
Return values
string

getPropertyDefaults()

private getPropertyDefaults() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPropertyValidators()

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

MissingClosureParamType

Return values
array<string|int, callable>

setupStateCookies()

Setup SDK cookie state.

private setupStateCookies() : void
Return values
void

setupStateFactories()

Setup SDK factories.

private setupStateFactories() : void
Tags
throws
NotFoundException

when a PSR-18 or PSR-17 are not configured, and cannot be discovered

codeCoverageIgnore
Return values
void

setupStateStorage()

Setup SDK storage state.

private setupStateStorage() : void
Return values
void

validateProperties()

private validateProperties() : void
Tags
psalm-suppress

MissingClosureParamType,MissingClosureReturnType

Return values
void

validateState()

Setup SDK validators based on strategy type.

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

validateStateApi()

Run validations for an API-only usage configuration.

private validateStateApi() : void
Return values
void

validateStateManagement()

Run validations for a Management-only usage configuration.

private validateStateManagement() : void
Return values
void

validateStateWebApp()

Run validations for a general webapp usage configuration.

private validateStateWebApp() : void
Return values
void

Search results