PHP Класс Auth0\SDK\API\Oauth2Client

Автор: Auth0
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$URL_MAP array Auth0 URL Map.
$persistantMap array Available keys to persist data.

Защищенные свойства (Protected)

Свойство Тип Описание
$access_token string NULL means that there is no authorization yet.
$client_id string Auth0 Client ID
$client_secret string Auth0 Client Secret
$debug_mode boolean Debug mode flag.
$debugger Closure Will be called only if $debug_mode is true.
$domain string Auth0 Domain.
$oauth_client OAuth2\Client OAuth2 Client.
$redirect_uri string Redirect URI needed on OAuth2 requests.
$refresh_token string Auth0 Refresh Token
$user string The user object

Открытые методы

Метод Описание
__construct ( array $config ) BaseAuth0 Constructor.
checkRequirements ( ) Checks for all dependencies of SDK or API.
debugInfo ( mixed $info ) If debug mode is set, sends $info to debugger \Closure.
deleteAllPersistentData ( ) Deletes all persistent data, for every mapped key.
exchangeCode ( ) : boolean Exchanges the code from the URI parameters for an access token, id token and user info
getAccessToken ( ) : string Gets $access_token.
getAppMetadata ( )
getClientId ( ) : string Gets $client_id.
getClientSecret ( ) : string Gets $client_secret.
getDebugMode ( ) : boolean Gets $debug_mode.
getDebugger ( ) : Closure Gets $debugger.
getDomain ( ) : string Gets $domain
getIdToken ( ) : string Gets the id token
getRedirectUri ( ) : string Gets $redirect_uri.
getRefreshToken ( ) : string Gets $refresh_token.
getUser ( ) : array Requests user info to Auth0 server.
getUserMetadata ( )
logout ( ) Logout (removes all persisten data)
setAccessToken ( string $access_token ) : Auth0\SDK\BaseAuth0 Sets and persists $access_token.
setClientId ( string $client_id ) : Auth0\SDK\BaseAuth0 Sets $client_id.
setClientSecret ( string $client_secret ) : Auth0\SDK\BaseAuth0 Sets $client_secret.
setDebugMode ( boolean $debug_mode ) : Auth0\SDK\BaseAuth0 Sets $debug_mode.
setDebugger ( Closure $debugger ) : Auth0\SDK\BaseAuth0 Sets $debugger.
setDomain ( string $domain ) : Auth0\SDK\BaseAuth0 Sets $domain.
setIdToken ( string $id_token ) : Auth0\SDK\BaseAuth0 Sets and persists $id_token.
setRedirectUri ( string $redirect_uri ) : Auth0\SDK\BaseAuth0 Sets $redirect_uri.
setRefreshToken ( string $refresh_token ) : Auth0\SDK\BaseAuth0 Sets and persists $refresh_token.
setUser ( $user )
updateUserMetadata ( $metadata ) : User Updathes the user metadata. This end up calling the path /users/{id_user} To delete an attribute, just set it null. ie: [ 'old_attr' => null ] It will only update the existing attrs and keep the others untouch for more info: https://auth0.com/docs/apiv2#!/users/patch_users_by_id

Защищенные методы

Метод Описание
generateUrl ( string $domain_key, string $path = '/' ) : string Constructs an API URL.

Приватные методы

Метод Описание
dontPersist ( String $name ) Removes $name from the persistantMap, thus not persisting it when we set the value

Описание методов

__construct() публичный метод

Configuration: - domain (String) Required. Should match your Auth0 domain - client_id (String) Required. The id of the application, you can get this in the auth0 console - client_secret (String) Required. The application secret, same comment as above - redirect_uri (String) Required. The uri of the auth callback, used as a security method - persist_user (Boolean) Optional. Indicates if you want to persist the user info, default true - persist_access_token (Boolean) Optional. Indicates if you want to persist the access token, default false - persist_refresh_token (Boolean) Optional. Indicates if you want to persist the refresh token, default false - persist_id_token (Boolean) Optional. Indicates if you want to persist the id token, default false - store (Mixed) Optional. Indicates how we store the persisting methods, default is session store, you can pass false to avoid storing it or a class that implements a store (get, set, delete). TODO: add a proper interface - debug (Boolean) Optional. Default false
public __construct ( array $config )
$config array Required

checkRequirements() закрытый публичный метод

Checks for all dependencies of SDK or API.
final public checkRequirements ( )

debugInfo() публичный метод

If debug mode is set, sends $info to debugger \Closure.
public debugInfo ( mixed $info )
$info mixed Info to debug. It will be converted to string.

deleteAllPersistentData() публичный метод

Deletes all persistent data, for every mapped key.

exchangeCode() публичный метод

Exchanges the code from the URI parameters for an access token, id token and user info
public exchangeCode ( ) : boolean
Результат boolean Whether it exchanged the code or not correctly

generateUrl() закрытый защищенный метод

Constructs an API URL.
final protected generateUrl ( string $domain_key, string $path = '/' ) : string
$domain_key string
$path string
Результат string

getAccessToken() закрытый публичный метод

Gets $access_token.
final public getAccessToken ( ) : string
Результат string

getAppMetadata() публичный метод

public getAppMetadata ( )

getClientId() закрытый публичный метод

Gets $client_id.
final public getClientId ( ) : string
Результат string

getClientSecret() закрытый публичный метод

Gets $client_secret.
final public getClientSecret ( ) : string
Результат string

getDebugMode() закрытый публичный метод

Gets $debug_mode.
final public getDebugMode ( ) : boolean
Результат boolean

getDebugger() закрытый публичный метод

Gets $debugger.
final public getDebugger ( ) : Closure
Результат Closure

getDomain() закрытый публичный метод

Gets $domain
final public getDomain ( ) : string
Результат string

getIdToken() закрытый публичный метод

Gets the id token
final public getIdToken ( ) : string
Результат string

getRedirectUri() закрытый публичный метод

Gets $redirect_uri.
final public getRedirectUri ( ) : string
Результат string

getRefreshToken() закрытый публичный метод

Gets $refresh_token.
final public getRefreshToken ( ) : string
Результат string

getUser() публичный метод

Requests user info to Auth0 server.
public getUser ( ) : array
Результат array

getUserMetadata() публичный метод

public getUserMetadata ( )

logout() закрытый публичный метод

Logout (removes all persisten data)
final public logout ( )

setAccessToken() публичный метод

Sets and persists $access_token.
public setAccessToken ( string $access_token ) : Auth0\SDK\BaseAuth0
$access_token string
Результат Auth0\SDK\BaseAuth0

setClientId() закрытый публичный метод

Sets $client_id.
final public setClientId ( string $client_id ) : Auth0\SDK\BaseAuth0
$client_id string
Результат Auth0\SDK\BaseAuth0

setClientSecret() закрытый публичный метод

Sets $client_secret.
final public setClientSecret ( string $client_secret ) : Auth0\SDK\BaseAuth0
$client_secret string
Результат Auth0\SDK\BaseAuth0

setDebugMode() закрытый публичный метод

Sets $debug_mode.
final public setDebugMode ( boolean $debug_mode ) : Auth0\SDK\BaseAuth0
$debug_mode boolean
Результат Auth0\SDK\BaseAuth0

setDebugger() закрытый публичный метод

Sets $debugger.
final public setDebugger ( Closure $debugger ) : Auth0\SDK\BaseAuth0
$debugger Closure
Результат Auth0\SDK\BaseAuth0

setDomain() закрытый публичный метод

Sets $domain.
final public setDomain ( string $domain ) : Auth0\SDK\BaseAuth0
$domain string
Результат Auth0\SDK\BaseAuth0

setIdToken() публичный метод

Sets and persists $id_token.
public setIdToken ( string $id_token ) : Auth0\SDK\BaseAuth0
$id_token string
Результат Auth0\SDK\BaseAuth0

setRedirectUri() закрытый публичный метод

Sets $redirect_uri.
final public setRedirectUri ( string $redirect_uri ) : Auth0\SDK\BaseAuth0
$redirect_uri string
Результат Auth0\SDK\BaseAuth0

setRefreshToken() публичный метод

Sets and persists $refresh_token.
public setRefreshToken ( string $refresh_token ) : Auth0\SDK\BaseAuth0
$refresh_token string
Результат Auth0\SDK\BaseAuth0

setUser() публичный метод

public setUser ( $user )

updateUserMetadata() публичный метод

Updathes the user metadata. This end up calling the path /users/{id_user} To delete an attribute, just set it null. ie: [ 'old_attr' => null ] It will only update the existing attrs and keep the others untouch for more info: https://auth0.com/docs/apiv2#!/users/patch_users_by_id
public updateUserMetadata ( $metadata ) : User
Результат User data

Описание свойств

$URL_MAP публичное статическое свойство

Auth0 URL Map.
public static array $URL_MAP
Результат array

$access_token защищенное свойство

NULL means that there is no authorization yet.
protected string $access_token
Результат string

$client_id защищенное свойство

Auth0 Client ID
protected string $client_id
Результат string

$client_secret защищенное свойство

Auth0 Client Secret
protected string $client_secret
Результат string

$debug_mode защищенное свойство

Debug mode flag.
protected bool $debug_mode
Результат boolean

$debugger защищенное свойство

Will be called only if $debug_mode is true.
protected Closure $debugger
Результат Closure

$domain защищенное свойство

Auth0 Domain.
protected string $domain
Результат string

$oauth_client защищенное свойство

OAuth2 Client.
protected Client,OAuth2 $oauth_client
Результат OAuth2\Client

$persistantMap публичное свойство

Available keys to persist data.
public array $persistantMap
Результат array

$redirect_uri защищенное свойство

Redirect URI needed on OAuth2 requests.
protected string $redirect_uri
Результат string

$refresh_token защищенное свойство

Auth0 Refresh Token
protected string $refresh_token
Результат string

$user защищенное свойство

The user object
protected string $user
Результат string