class OAuthProvider

This class, which represents an OAuth provider, stores the configuration parameters related to this provider.

Constants

TYPES

Properties

private string $name
private string $protocol
private string $version
private string $client_id
private string $client_secret
private string $redirect_uri
private string $discovery_endpoint
private string $authorization_endpoint
private string $token_endpoint
private string $registration_endpoint
private string $introspection_endpoint
private string $revocation_endpoint
private string $request_token_endpoint
private string $userinfo_endpoint
private string $end_session_endpoint
private string $pin_dialog_url
private string $pin
private string $jwks_uri
private array $scopes_supported
private array $response_types_supported
private array $response_modes_supported
private array $token_endpoint_auth_methods_supported
private array $subject_types_supported
private array $id_token_signing_alg_values_supported
private array $claims_supported
private array $mapping
private string $api_key
private string $username
private string $password
private string $realm

Methods

__construct(string $name, string $client_id = '', string $client_secret = '', string $redirect_uri = '')

Constructs a OAuthProvider instance with the registered data of the client with the OAuth provider.

string
getName()

Returns the name of the provider

string
getProtocol()

Returns the OAuth-based protocol, either 'oauth' or 'openid'

string
getVersion()

Returns the version of the protocol supported by the OAuth provider

string
getClientId()

Returns the identifier of your application registered with the OAuth provider.

string
getClientSecret()

Returns the secret value assigned to your application.

string
getRedirectUri()

Returns the URL of the current script page that is calling this class

string
getDiscoveryEndpoint()

Returns the discovery endpoint.

string
getAuthorizationEndpoint()

Returns the authorization endpoint.

string
getTokenEndpoint()

Returns the token endpoint

string
getRegistrationEndpoint()

Returns the client dynamic registration endpoint

string
getIntrospectionEndpoint()

Returns the introspection endpoint

string
getRevocationEndpoint()

Returns the revocation endpoint

string
getRequestTokenEndpoint()

Returns the request token endpoint

string
getUserinfoEndpoint()

Returns the UserInfo endpoint

string
getEndSessionEndpoint()

Returns the end session endpoint

string
getPinDialogUrl()

Returns the pin dialog url

string
getPin()

Returns the value of the PIN code

string
getJwksUri()

Returns the Jwks URI

array
getScopesSupported()

Returns the scope values supported by the OAuth provider.

array
getResponseTypesSupported()

Returns the response_type values supported by the OAuth provider.

array
getResponseModesSupported()

Returns the response_mode values supported by the OAuth provider.

array
getTokenEndpointAuthMethodsSupported()

Returns the authentication methods supported by the OAuth provider.

array
getSubjectTypesSupported()

Returns the subject identifier types supported by the OAuth provider.

array
getIdTokenSigningAlgValuesSupported()

Returns the list of JWS signing algorithms supported by the OAuth provider.

array
getClaimsSupported()

Returns the claims supported by the OAuth provider.

string
getUserIdField()

Returns the field of the user info corresponding to the user identifier.

array
getMapping()

Returns the fields mapping between the OAuth client and the OAuth provider.

string
getApiKey()

Returns the identifier of the API key provided by the OAuth provider.

string
getUsername()

Returns the OAuth user name to use with password authorization

string
getPassword()

Returns the OAuth password to use with password authorization

string
getRealm()

Returns the realm of authorization for OpenID Connect

setProtocol(string $protocol)

Sets the OAuth-based protocol, either 'oauth' or 'openid'

setVersion(string $version)

Sets the version of the protocol supported by the OAuth provider

setClientId(string $client_id)

Sets the identifier of your application registered with the OAuth provider.

setClientSecret(string $client_secret)

Sets the secret value assigned to your application.

setRedirectUri(string $redirect_uri)

Sets the URL of the current script page that is calling this class

setDiscoveryEndpoint(string $discovery_endpoint)

Sets the discovery endpoint.

setAuthorizationEndpoint(string $authorization_endpoint)

Sets the authorization endpoint.

setTokenEndpoint(string $token_endpoint)

Sets the token endpoint

setRegistrationEndpoint(string $registration_endpoint)

Sets the client dynamic registration endpoint

setIntrospectionEndpoint(string $introspection_endpoint)

Sets the introspection endpoint

setRevocationEndpoint(string $revocation_endpoint)

Sets the revocation endpoint

setRequestTokenEndpoint(string $request_token_endpoint)

Sets the request token endpoint

setUserinfoEndpoint(string $userinfo_endpoint)

Sets the UserInfo endpoint

setEndSessionEndpoint(string $end_session_endpoint)

Sets the end session endpoint

setPinDialogUrl(string $pin_dialog_url)

Sets the pin dialog url

setPin(string $pin)

Sets the value of the PIN code

setJwksUri(string $jwks_uri)

Sets the Jwks URI

setScopesSupported(array $scopes_supported)

Sets the scope values supported by the OAuth provider.

setResponseTypesSupported(array $response_types_supported)

Sets the response_type values supported by the OAuth provider.

setResponseModesSupported(array $response_modes_supported)

Sets the response_mode values supported by the OAuth provider.

setTokenEndpointAuthMethodsSupported(array $token_endpoint_auth_methods_supported)

Sets the authentication methods supported by the OAuth provider.

setSubjectTypesSupported(array $subject_types_supported)

Sets the subject identifier types supported by the OAuth provider.

setIdTokenSigningAlgValuesSupported(array $id_token_signing_alg_values_supported)

Sets the list of JWS signing algorithms supported by the OAuth provider.

setClaimsSupported(array $claims_supported)

Sets the claims supported by the OAuth provider.

setUserIdField(string $user_id_field)

Sets the field of the user info corresponding to the user identifier.

setMapping(array $mapping)

Sets the fields mapping between the OAuth client and the OAuth provider.

setApiKey(string $api_key)

Sets the identifier of the API key provided by the OAuth provider.

setUsername(string $username)

Sets the OAuth user name to use with password authorization

setPassword(string $password)

Sets the OAuth password to use with password authorization

setRealm(string $realm)

Sets the realm of authorization for OpenID Connect

void
bind(array $configuration)

Binds the configuration parameters to the properties of this instance of the OAuth provider.

array
toArray()

Returns the OAuth provider configuration as an array

string
makeDefaultRedirectUri()

Constructs a default redirect URI from the superglobals.

Details

at line 370
__construct(string $name, string $client_id = '', string $client_secret = '', string $redirect_uri = '')

Constructs a OAuthProvider instance with the registered data of the client with the OAuth provider.

The name of the provider given in parameter can be that of a built-in provider or not. If it is not a built-in provider, you must provide the configuration parameters in the options argument of the initialize(...) function.

Parameters

string $name The name of the OAuth provider
string $client_id The identifier of your application registered with the OAuth provider
string $client_secret The secret value assigned to your application
string $redirect_uri The URL of the current script page that is calling this class

at line 382
string getName()

Returns the name of the provider

Return Value

string

at line 391
string getProtocol()

Returns the OAuth-based protocol, either 'oauth' or 'openid'

Return Value

string

at line 400
string getVersion()

Returns the version of the protocol supported by the OAuth provider

Return Value

string

at line 409
string getClientId()

Returns the identifier of your application registered with the OAuth provider.

Return Value

string

at line 418
string getClientSecret()

Returns the secret value assigned to your application.

Return Value

string

at line 427
string getRedirectUri()

Returns the URL of the current script page that is calling this class

Return Value

string

at line 436
string getDiscoveryEndpoint()

Returns the discovery endpoint.

Return Value

string

at line 445
string getAuthorizationEndpoint()

Returns the authorization endpoint.

Return Value

string

at line 454
string getTokenEndpoint()

Returns the token endpoint

Return Value

string

at line 463
string getRegistrationEndpoint()

Returns the client dynamic registration endpoint

Return Value

string

at line 472
string getIntrospectionEndpoint()

Returns the introspection endpoint

Return Value

string

at line 481
string getRevocationEndpoint()

Returns the revocation endpoint

Return Value

string

at line 490
string getRequestTokenEndpoint()

Returns the request token endpoint

Return Value

string

at line 499
string getUserinfoEndpoint()

Returns the UserInfo endpoint

Return Value

string

at line 508
string getEndSessionEndpoint()

Returns the end session endpoint

Return Value

string

at line 517
string getPinDialogUrl()

Returns the pin dialog url

Return Value

string

at line 526
string getPin()

Returns the value of the PIN code

Return Value

string

at line 535
string getJwksUri()

Returns the Jwks URI

Return Value

string

at line 544
array getScopesSupported()

Returns the scope values supported by the OAuth provider.

Return Value

array

at line 553
array getResponseTypesSupported()

Returns the response_type values supported by the OAuth provider.

Return Value

array

at line 562
array getResponseModesSupported()

Returns the response_mode values supported by the OAuth provider.

Return Value

array

at line 571
array getTokenEndpointAuthMethodsSupported()

Returns the authentication methods supported by the OAuth provider.

Return Value

array

at line 580
array getSubjectTypesSupported()

Returns the subject identifier types supported by the OAuth provider.

Return Value

array

at line 589
array getIdTokenSigningAlgValuesSupported()

Returns the list of JWS signing algorithms supported by the OAuth provider.

Return Value

array

at line 598
array getClaimsSupported()

Returns the claims supported by the OAuth provider.

Return Value

array

at line 607
string getUserIdField()

Returns the field of the user info corresponding to the user identifier.

Return Value

string

at line 616
array getMapping()

Returns the fields mapping between the OAuth client and the OAuth provider.

Return Value

array

at line 625
string getApiKey()

Returns the identifier of the API key provided by the OAuth provider.

Return Value

string

at line 634
string getUsername()

Returns the OAuth user name to use with password authorization

Return Value

string

at line 643
string getPassword()

Returns the OAuth password to use with password authorization

Return Value

string

at line 652
string getRealm()

Returns the realm of authorization for OpenID Connect

Return Value

string

at line 661
OAuthProvider setProtocol(string $protocol)

Sets the OAuth-based protocol, either 'oauth' or 'openid'

Parameters

string $protocol

Return Value

OAuthProvider

at line 671
OAuthProvider setVersion(string $version)

Sets the version of the protocol supported by the OAuth provider

Parameters

string $version

Return Value

OAuthProvider

at line 681
OAuthProvider setClientId(string $client_id)

Sets the identifier of your application registered with the OAuth provider.

Parameters

string $client_id

Return Value

OAuthProvider

at line 691
OAuthProvider setClientSecret(string $client_secret)

Sets the secret value assigned to your application.

Parameters

string $client_secret

Return Value

OAuthProvider

at line 701
OAuthProvider setRedirectUri(string $redirect_uri)

Sets the URL of the current script page that is calling this class

Parameters

string $redirect_uri

Return Value

OAuthProvider

at line 711
OAuthProvider setDiscoveryEndpoint(string $discovery_endpoint)

Sets the discovery endpoint.

Parameters

string $discovery_endpoint

Return Value

OAuthProvider

at line 721
OAuthProvider setAuthorizationEndpoint(string $authorization_endpoint)

Sets the authorization endpoint.

Parameters

string $authorization_endpoint

Return Value

OAuthProvider

at line 731
OAuthProvider setTokenEndpoint(string $token_endpoint)

Sets the token endpoint

Parameters

string $token_endpoint

Return Value

OAuthProvider

at line 741
OAuthProvider setRegistrationEndpoint(string $registration_endpoint)

Sets the client dynamic registration endpoint

Parameters

string $registration_endpoint

Return Value

OAuthProvider

at line 751
OAuthProvider setIntrospectionEndpoint(string $introspection_endpoint)

Sets the introspection endpoint

Parameters

string $introspection_endpoint

Return Value

OAuthProvider

at line 761
OAuthProvider setRevocationEndpoint(string $revocation_endpoint)

Sets the revocation endpoint

Parameters

string $revocation_endpoint

Return Value

OAuthProvider

at line 771
OAuthProvider setRequestTokenEndpoint(string $request_token_endpoint)

Sets the request token endpoint

Parameters

string $request_token_endpoint

Return Value

OAuthProvider

at line 781
OAuthProvider setUserinfoEndpoint(string $userinfo_endpoint)

Sets the UserInfo endpoint

Parameters

string $userinfo_endpoint

Return Value

OAuthProvider

at line 791
OAuthProvider setEndSessionEndpoint(string $end_session_endpoint)

Sets the end session endpoint

Parameters

string $end_session_endpoint

Return Value

OAuthProvider

at line 801
OAuthProvider setPinDialogUrl(string $pin_dialog_url)

Sets the pin dialog url

Parameters

string $pin_dialog_url

Return Value

OAuthProvider

at line 811
OAuthProvider setPin(string $pin)

Sets the value of the PIN code

Parameters

string $pin

Return Value

OAuthProvider

at line 821
OAuthProvider setJwksUri(string $jwks_uri)

Sets the Jwks URI

Parameters

string $jwks_uri

Return Value

OAuthProvider

at line 831
OAuthProvider setScopesSupported(array $scopes_supported)

Sets the scope values supported by the OAuth provider.

Parameters

array $scopes_supported

Return Value

OAuthProvider

at line 841
OAuthProvider setResponseTypesSupported(array $response_types_supported)

Sets the response_type values supported by the OAuth provider.

Parameters

array $response_types_supported

Return Value

OAuthProvider

at line 851
OAuthProvider setResponseModesSupported(array $response_modes_supported)

Sets the response_mode values supported by the OAuth provider.

Parameters

array $response_modes_supported

Return Value

OAuthProvider

at line 861
OAuthProvider setTokenEndpointAuthMethodsSupported(array $token_endpoint_auth_methods_supported)

Sets the authentication methods supported by the OAuth provider.

Parameters

array $token_endpoint_auth_methods_supported

Return Value

OAuthProvider

at line 871
OAuthProvider setSubjectTypesSupported(array $subject_types_supported)

Sets the subject identifier types supported by the OAuth provider.

Parameters

array $subject_types_supported

Return Value

OAuthProvider

at line 881
OAuthProvider setIdTokenSigningAlgValuesSupported(array $id_token_signing_alg_values_supported)

Sets the list of JWS signing algorithms supported by the OAuth provider.

Parameters

array $id_token_signing_alg_values_supported

Return Value

OAuthProvider

at line 891
OAuthProvider setClaimsSupported(array $claims_supported)

Sets the claims supported by the OAuth provider.

Parameters

array $claims_supported

Return Value

OAuthProvider

at line 901
OAuthProvider setUserIdField(string $user_id_field)

Sets the field of the user info corresponding to the user identifier.

Parameters

string $user_id_field

Return Value

OAuthProvider

at line 911
OAuthProvider setMapping(array $mapping)

Sets the fields mapping between the OAuth client and the OAuth provider.

Parameters

array $mapping

Return Value

OAuthProvider

at line 921
OAuthProvider setApiKey(string $api_key)

Sets the identifier of the API key provided by the OAuth provider.

Parameters

string $api_key

Return Value

OAuthProvider

at line 931
OAuthProvider setUsername(string $username)

Sets the OAuth user name to use with password authorization

Parameters

string $username

Return Value

OAuthProvider

at line 941
OAuthProvider setPassword(string $password)

Sets the OAuth password to use with password authorization

Parameters

string $password

Return Value

OAuthProvider

at line 951
OAuthProvider setRealm(string $realm)

Sets the realm of authorization for OpenID Connect

Parameters

string $realm

Return Value

OAuthProvider

at line 964
void bind(array $configuration)

Binds the configuration parameters to the properties of this instance of the OAuth provider.

Parameters

array $configuration

Return Value

void throws \eureka2\OAuth\Exception\OAuthClientException

at line 995
array toArray()

Returns the OAuth provider configuration as an array

Return Value

array

at line 1031
protected string makeDefaultRedirectUri()

Constructs a default redirect URI from the superglobals.

Return Value

string the default redirect URI