PHP 클래스 Auth0\SDK\API\Oauth2Client

저자: Auth0
파일 보기 프로젝트 열기: auth0/auth0-php

공개 프로퍼티들

프로퍼티 타입 설명
$URL_MAP array Auth0 URL Map.
$persistantMap array Available keys to persist data.

보호된 프로퍼티들

프로퍼티 타입 설명
$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