AuthenticationInterface
extends
ClientInterface
in
Table of Contents
Methods
- addClientAuthentication() : array<string|int, mixed>
- Add client authentication to a request.
- clientCredentials() : ResponseInterface
- Makes a call to the `oauth/token` endpoint with `client_credentials` grant type.
- codeExchange() : ResponseInterface
- Makes a call to the `oauth/token` endpoint with `authorization_code` grant type.
- customTokenExchange() : ResponseInterface
- Exchange an external or custom token for Auth0 tokens using the token exchange grant (RFC 8693).
- dbConnectionsChangePassword() : ResponseInterface
- Send a change password email.
- dbConnectionsSignup() : ResponseInterface
- Create a new user using active authentication.
- emailPasswordlessStart() : ResponseInterface
- Start passwordless login process for email.
- getConfiguration() : SdkConfiguration
- Return an instance of SdkConfiguration.
- getHttpClient() : HttpClient
- Return an instance of HttpClient.
- getLastRequest() : HttpRequest|null
- Return an instance of HttpRequest representing the last issued request.
- getLoginLink() : string
- Build the login URL.
- getLogoutLink() : string
- Builds and returns a logout URL to terminate an SSO session.
- getSamlpLink() : string
- Build and return a SAMLP link.
- getSamlpMetadataLink() : string
- Build and return a SAMLP metadata link.
- getWsfedLink() : string
- Build and return a WS-Federation link.
- getWsfedMetadataLink() : string
- Build and return a WS-Federation metadata link.
- login() : ResponseInterface
- Makes a call to the `oauth/token` endpoint with `password-realm` grant type.
- loginWithDefaultDirectory() : ResponseInterface
- Makes a call to the `oauth/token` endpoint with `password` grant type.
- oauthToken() : ResponseInterface
- Makes a call to the `oauth/token` endpoint.
- passwordlessStart() : ResponseInterface
- Start passwordless login process.
- pushedAuthorizationRequest() : PushedAuthorizationRequest
- Returns an instance of the Pushed Authorization Request endpoint class.
- refreshToken() : ResponseInterface
- Use a refresh token grant to get new tokens.
- smsPasswordlessStart() : ResponseInterface
- Start passwordless login process for SMS.
- userInfo() : ResponseInterface
- Make an authenticated request to the /userinfo endpoint.
Methods
addClientAuthentication()
Add client authentication to a request.
public
addClientAuthentication(array<string|int, mixed> $content) : array<string|int, mixed>
Parameters
- $content : array<string|int, mixed>
-
Request being sent to the endpoint.
Tags
Return values
array<string|int, mixed> —Request, with client authentication added.
clientCredentials()
Makes a call to the `oauth/token` endpoint with `client_credentials` grant type.
public
clientCredentials([null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacecodeExchange()
Makes a call to the `oauth/token` endpoint with `authorization_code` grant type.
public
codeExchange(string $code[, null|string $redirectUri = null ][, null|string $codeVerifier = null ]) : ResponseInterface
Parameters
- $code : string
-
authorization code received during login
- $redirectUri : null|string = null
-
Optional. Redirect URI sent with authorize request. Defaults to the SDK's configured redirectUri.
- $codeVerifier : null|string = null
-
Optional. The clear-text version of the code_challenge from the /authorize call
Tags
Return values
ResponseInterfacecustomTokenExchange()
Exchange an external or custom token for Auth0 tokens using the token exchange grant (RFC 8693).
public
customTokenExchange(string $subjectToken, string $subjectTokenType[, null|string $actorToken = null ][, null|string $actorTokenType = null ][, null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Returns the raw token response and has no session side effects. Use this for delegation and machine-to-machine scenarios.
Parameters
- $subjectToken : string
-
the token being exchanged
- $subjectTokenType : string
-
a URI identifying the type of
subjectToken. Any custom URI scheme is accepted (e.g.urn:acme:token). - $actorToken : null|string = null
-
Optional. A token representing the acting party for delegation. Requires
actorTokenType. - $actorTokenType : null|string = null
-
Optional. A URI identifying the type of
actorToken. RequiresactorToken. - $params : null|array<string|int, null|int|string> = null
-
Optional. Additional content to include in the body of the API request, such as
audience,scope, andorganization. Thegrant_type,client_id,subject_token,subject_token_type,actor_token, andactor_token_typekeys are controlled by the SDK and cannot be overridden here. - $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacedbConnectionsChangePassword()
Send a change password email.
public
dbConnectionsChangePassword(string $email, string $connection[, null|array<string|int, mixed> $body = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
This endpoint only works for database connections.
Parameters
- $email : string
-
email for the user changing their password
- $connection : string
-
the name of the database connection this user is in
- $body : null|array<string|int, mixed> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacedbConnectionsSignup()
Create a new user using active authentication.
public
dbConnectionsSignup(string $email, string $password, string $connection[, null|array<string|int, mixed> $body = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
This endpoint only works for database connections.
Parameters
- $email : string
-
email for the user signing up
- $password : string
-
new password for the user signing up
- $connection : string
-
database connection to create the user in
- $body : null|array<string|int, mixed> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfaceemailPasswordlessStart()
Start passwordless login process for email.
public
emailPasswordlessStart(string $email, string $type[, null|array<string, null|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $email : string
-
email address to use
- $type : string
-
use null or "link" to send a link, use "code" to send a verification code
- $params : null|array<string, null|string> = null
-
Optional. Append or override the link parameters (like scope, redirect_uri, protocol, response_type) when you send a link using email.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacegetConfiguration()
Return an instance of SdkConfiguration.
public
getConfiguration() : SdkConfiguration
Return values
SdkConfigurationgetHttpClient()
Return an instance of HttpClient.
public
getHttpClient() : HttpClient
Return values
HttpClientgetLastRequest()
Return an instance of HttpRequest representing the last issued request.
public
getLastRequest() : HttpRequest|null
Return values
HttpRequest|nullgetLoginLink()
Build the login URL.
public
getLoginLink(string $state[, null|string $redirectUri = null ][, null|array<string|int, null|int|string> $params = null ]) : string
Parameters
- $state : string
-
A CSRF mitigating value, also useful for restoring the previous state of your app. See https://auth0.com/docs/protocols/state-parameters
- $redirectUri : null|string = null
-
Optional. URI to return to after logging out. Defaults to the SDK's configured redirectUri.
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional parameters to include with the request. The
client_id,response_type, andresponse_modekeys are controlled by the SDK and cannot be overridden here. See @see for details.
Tags
Return values
stringgetLogoutLink()
Builds and returns a logout URL to terminate an SSO session.
public
getLogoutLink([null|string $returnTo = null ][, null|array<string|int, null|int|string> $params = null ]) : string
Parameters
- $returnTo : null|string = null
-
Optional. URI to return to after logging out. Defaults to the SDK's configured redirectUri.
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional parameters to include with the request. The
client_id,response_type, andresponse_modekeys are controlled by the SDK and cannot be overridden here.
Tags
Return values
stringgetSamlpLink()
Build and return a SAMLP link.
public
getSamlpLink([null|string $clientId = null ][, null|string $connection = null ]) : string
Parameters
- $clientId : null|string = null
-
Optional. Client ID to use. Defaults to the SDK's configured Client ID.
- $connection : null|string = null
-
Optional. The connection to use. If no connection is specified, the Auth0 Login Page will be shown.
Tags
Return values
stringgetSamlpMetadataLink()
Build and return a SAMLP metadata link.
public
getSamlpMetadataLink([null|string $clientId = null ]) : string
Parameters
- $clientId : null|string = null
-
Optional. Client ID to use. Defaults to the SDK's configured Client ID.
Tags
Return values
stringgetWsfedLink()
Build and return a WS-Federation link.
public
getWsfedLink([null|string $clientId = null ][, null|array<string|int, null|int|string> $params = null ]) : string
Parameters
- $clientId : null|string = null
-
Optional. Client ID to use. Defaults to the SDK's configured Client ID.
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional parameters to include with the request. See @see for details.
Tags
Return values
stringgetWsfedMetadataLink()
Build and return a WS-Federation metadata link.
public
getWsfedMetadataLink() : string
Tags
Return values
stringlogin()
Makes a call to the `oauth/token` endpoint with `password-realm` grant type.
public
login(string $username, string $password, string $realm[, null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $username : string
-
username of the resource owner
- $password : string
-
password of the resource owner
- $realm : string
-
database realm the user belongs to
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfaceloginWithDefaultDirectory()
Makes a call to the `oauth/token` endpoint with `password` grant type.
public
loginWithDefaultDirectory(string $username, string $password[, null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $username : string
-
username of the resource owner
- $password : string
-
password of the resource owner
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfaceoauthToken()
Makes a call to the `oauth/token` endpoint.
public
oauthToken(string $grantType[, null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $grantType : string
-
Denotes the type of flow being used. See @see for details.
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacepasswordlessStart()
Start passwordless login process.
public
passwordlessStart([null|array<string|int, mixed> $body = null ][, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $body : null|array<string|int, mixed> = null
-
Optional. Additional content to include in the body of the API request. See @see for details.
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfacepushedAuthorizationRequest()
Returns an instance of the Pushed Authorization Request endpoint class.
public
pushedAuthorizationRequest() : PushedAuthorizationRequest
Return values
PushedAuthorizationRequestrefreshToken()
Use a refresh token grant to get new tokens.
public
refreshToken(string $refreshToken[, null|array<string|int, null|int|string> $params = null ][, null|array<string|int, int>|array<string|int, string> $headers = null ]) : ResponseInterface
Parameters
- $refreshToken : string
-
refresh token to use
- $params : null|array<string|int, null|int|string> = null
-
Optional. Additional parameters to include with the request.
- $headers : null|array<string|int, int>|array<string|int, string> = null
-
Optional. Additional headers to send with the request.
Tags
Return values
ResponseInterfacesmsPasswordlessStart()
Start passwordless login process for SMS.
public
smsPasswordlessStart(string $phoneNumber[, null|array<string|int, int|string> $headers = null ]) : ResponseInterface
Parameters
- $phoneNumber : string
-
phone number to use
- $headers : null|array<string|int, int|string> = null
-
Optional. Additional headers to send with the API request.
Tags
Return values
ResponseInterfaceuserInfo()
Make an authenticated request to the /userinfo endpoint.
public
userInfo(string $accessToken) : ResponseInterface
Parameters
- $accessToken : string
-
bearer token to use for the request