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|null | $jwksUrl | ||
| protected string|null | $issuerUrl | ||
| protected string|null | $userinfoEndpointUrl | ||
| 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
Start Authorization Code Grant flow (redirect to authorizeUrl)
No description
Get application's Client ID.
Get application's Client Secret
No description
No description
No description
Get potential ID Token (OIDC)
No description
No description
No description
No description
No description
No description
Returns the scope as array.
No description
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
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
No description
Start Authorization Code Grant flow (redirect to authorizeUrl)
No description
Details
at line 170
__construct(string $clientId = null, string $clientSecret = null, string $redirectUrl = null)
OAuthClient constructor.
at line 320
OAuthClient
addScope($scope)
Adds a new scope to the existing scopes.
at line 397
disconnect(string $redirect_url)
Logout
at line 782
OAuthClient
fromArray(array $data)
No description
at line 535
protected AccessToken
getAccessToken()
| internal |
Function to test connection directly to an oauth server
at line 547
string
getAccessTokenAsString()
No description
at line 270
mixed
getAccessTokenUrl()
No description
at line 605
string
getAuthorizationUrl()
Start Authorization Code Grant flow (redirect to authorizeUrl)
at line 253
mixed
getAuthorizeUrl()
No description
at line 196
string
getClientId()
Get application's Client ID.
at line 217
string
getClientSecret()
Get application's Client Secret
at line 386
string
getCode()
No description
at line 416
string
getEndSessionUrl()
No description
at line 372
int
getExpires()
No description
at line 559
string|null
getIdToken()
Get potential ID Token (OIDC)
at line 452
string|null
getIssuerUrl()
No description
at line 434
string|null
getJwksUrl()
No description
at line 408
string
getPostLogoutRedirectUrl(string $redirect_url)
No description
at line 236
string
getRedirectUrl()
No description
at line 355
string
getRefreshToken()
No description
at line 287
string
getScope()
No description
at line 309
array
getScopeArray()
Returns the scope as array.
at line 338
string
getState()
No description
at line 469
string|null
getUserinfoEndpointUrl()
No description
at line 379
int
hasExpired()
No description
at line 490
bool
isConnected()
Prove connection within xelos intranet to avoid to much request to an oauth server
at line 585
bool
isPersonal()
No description
at line 855
bool
isSendBasicAuthorization()
No description
at line 644
bool
processAuthorizationCodeResponse(string $code)
Process Authorization Code Grant
at line 182
processOpenIDConfiguration(OpenIDConfiguration $config)
Use an OpenID Configuration to setup this OAuth client
at line 505
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 572
OAuthClient
setAccessToken(AccessToken $token = null)
No description
at line 279
OAuthClient
setAccessTokenUrl(mixed $accessTokenUrl)
No description
at line 262
OAuthClient
setAuthorizeUrl(mixed $authorizeUrl)
No description
at line 208
OAuthClient
setClientId(string $clientId)
Set application's Client ID.
Find this value at your Application's Settings.
at line 228
OAuthClient
setClientSecret(mixed $clientSecret)
Set application's Client Secret
at line 425
$this
setEndSessionUrl($endSessionEndpoint)
No description
at line 461
$this
setIssuerUrl(string|null $uri)
No description
at line 443
$this
setJwksUrl(string|null $uri)
No description
at line 330
OAuthClient
setOptionalAuthParams(array $params)
No description
at line 879
OAuthClient
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 596
OAuthClient
setPersonal(bool $isPersonal = true)
Defines whether the client is for personal or global usage.
at line 245
OAuthClient
setRedirectUrl(string $redirectUrl)
No description
at line 364
OAuthClient
setRefreshToken(string $token)
No description
at line 847
OAuthClient
setResource(null $resource = null)
Set additional resource param when requesting access code
at line 299
OAuthClient
setScope(string $scope)
Set scopes which you want to request authorization for.
These must be separated by a space.
at line 866
OAuthClient
setSendBasicAuthorization(bool $sendBasicAuthorization = true)
Should client_id and client_secret be sent as Basic Auth Header during code exchange?
at line 347
OAuthClient
setState(string $state)
No description
at line 478
$this
setUserinfoEndpointUrl(string|null $uri)
No description
at line 626
void
startAuthorisationCodeFlow()
Start Authorization Code Grant flow (redirect to authorizeUrl)
at line 719
array
toArray()
No description