OAuthClient
class OAuthClient
Class OAuthClient
Constants
GENERAL_ADMIN_MODE |
will be saved as user_id in oauth_access dbtable |
Properties
protected string | $clientId | The application's Client ID. |
|
protected string | $clientSecret | The application's Client Secret. |
|
protected string | $redirectUrl | The URL to which Auth will redirect the browser after authorization has been granted by the user. |
|
protected string | $authorizeUrl | The Authorization Endpoint performs Authentication of the End-User. |
|
protected string | $accessTokenUrl | To obtain an Access Token, an ID Token, and optionally a Refresh Token, the RP (Client) sends a Token Request to the Token Endpoint to obtain a Token Response |
|
protected string | $endSessionUrl | A URL where you can end a session by revoking an access_token. |
|
protected string | $scope | The scopes which you want to request authorization for. |
|
protected string | $state | An opaque value the application adds to the initial request that Auth includes when redirecting back to the application. |
|
protected AccessToken | $accessToken | Access token Object representing string like accessToken an authorization issued to the client refreshToken see refreshToken |
|
protected string | $refreshToken | Refresh tokens are issued to the client by the authorization server and are used to obtain a new access token when the current access token becomes invalid or expires |
|
protected int | $expires | The lifetime in seconds of the access token |
|
protected string | $code | The authorization code received from the authorization server |
|
protected | $resourceOwner | ||
protected bool | $isPersonal | false = Admin has created account |
Methods
OAuthClient constructor.
Adds a new scope to the existing scopes.
Logout
No description
Function to test connection directly to an oauth server
No description
No description
No description
Get application's Client ID.
Get application's Client Secret
No description
No description
No description
No description
No description
No description
No description
Returns the scope as array.
No description
No description
Prove connection within xelos intranet to avoid to much request to an oauth server
No description
No description
Process Authorization Code Grant
Use an OpenID Configuration to setup this OAuth client
Returns the access token or null if there is no token yet.
No description
No description
No description
Set application's Client ID.
Set application's Client Secret
No description
No description
Set Code Verifier and Code Challenge Method for RFC 7636: Proof Key for Code Exchange (PKCE) which is an alternative to client_secret or may be used in hybrid flows
Defines whether the client is for personal or global usage.
No description
No description
Set additional resource param when requesting access code
Set scopes which you want to request authorization for.
Should client_id and client_secret be sent as Basic Auth Header during code exchange?
No description
Start Authorization Code Grant flow (redirect to authorizeUrl)
No description
Details
at line 164
__construct(string $clientId = null, string $clientSecret = null, string $redirectUrl = null)
OAuthClient constructor.
at line 311
OAuthClient
addScope($scope)
Adds a new scope to the existing scopes.
at line 388
disconnect(string $redirect_url)
Logout
at line 685
OAuthClient
fromArray(array $data)
No description
at line 473
protected AccessToken
getAccessToken()
internal |
Function to test connection directly to an oauth server
at line 485
string
getAccessTokenAsString()
No description
at line 261
mixed
getAccessTokenUrl()
No description
at line 244
mixed
getAuthorizeUrl()
No description
at line 187
string
getClientId()
Get application's Client ID.
at line 208
string
getClientSecret()
Get application's Client Secret
at line 377
string
getCode()
No description
at line 407
string
getEndSessionUrl()
No description
at line 363
int
getExpires()
No description
at line 399
string
getPostLogoutRedirectUrl(string $redirect_url)
No description
at line 227
mixed
getRedirectUrl()
No description
at line 346
string
getRefreshToken()
No description
at line 278
string
getScope()
No description
at line 300
array
getScopeArray()
Returns the scope as array.
at line 329
string
getState()
No description
at line 370
int
hasExpired()
No description
at line 428
bool
isConnected()
Prove connection within xelos intranet to avoid to much request to an oauth server
at line 511
bool
isPersonal()
No description
at line 743
bool
isSendBasicAuthorization()
No description
at line 557
bool
processAuthorizationCodeResponse(string $code)
Process Authorization Code Grant
at line 176
processOpenIDConfiguration(OpenIDConfiguration $config)
Use an OpenID Configuration to setup this OAuth client
at line 443
AccessToken|null
refreshAccessToken()
Returns the access token or null if there is no token yet.
If there is a token and the token is expired, it will automatically request a new access token by using the refresh token.
at line 498
OAuthClient
setAccessToken(AccessToken $token = null)
No description
at line 270
OAuthClient
setAccessTokenUrl(mixed $accessTokenUrl)
No description
at line 253
OAuthClient
setAuthorizeUrl(mixed $authorizeUrl)
No description
at line 199
OAuthClient
setClientId(string $clientId)
Set application's Client ID.
Find this value at your Application's Settings.
at line 219
OAuthClient
setClientSecret(mixed $clientSecret)
Set application's Client Secret
at line 416
$this
setEndSessionUrl($endSessionEndpoint)
No description
at line 321
OAuthClient
setOptionalAuthParams(array $params)
No description
at line 761
setPKCEParams(string $codeVerifier, string $codeChallengeMethod = 'S256')
Set Code Verifier and Code Challenge Method for RFC 7636: Proof Key for Code Exchange (PKCE) which is an alternative to client_secret or may be used in hybrid flows
at line 522
OAuthClient
setPersonal(bool $isPersonal = true)
Defines whether the client is for personal or global usage.
at line 236
OAuthClient
setRedirectUrl(mixed $redirectUrl)
No description
at line 355
OAuthClient
setRefreshToken(string $token)
No description
at line 736
setResource($resource = null)
Set additional resource param when requesting access code
at line 290
OAuthClient
setScope(string $scope)
Set scopes which you want to request authorization for.
These must be separated by a space.
at line 751
void
setSendBasicAuthorization(bool $sendBasicAuthorization = true)
Should client_id and client_secret be sent as Basic Auth Header during code exchange?
at line 338
OAuthClient
setState(string $state)
No description
at line 531
startAuthorisationCodeFlow()
Start Authorization Code Grant flow (redirect to authorizeUrl)
at line 634
array
toArray()
No description