Property | Type | Description | |
---|---|---|---|
$accessToken | token provider by authenticator | ||
$authorizeUriParams | optional additional get parameters to be passed in the authorize_uri | ||
$defaultContentType | content type for API calls | ||
$profileRequestParams | optional additional get params to be passed in the request for profile | ||
$provider | stored information to connect with provider (secret, etc.) | ||
$providerKey | key for GDN_UserAuthenticationProvider table | ||
$requestAccessTokenParams | optional additional post parameters to be passed in the accessToken request | ||
$scope | passing scope to authenticator | ||
$settingsView |
Method | Description | |
---|---|---|
__construct ( string $providerKey, boolean | string $accessToken = false ) | Set up OAuth2 access properties. | |
accessToken ( boolean | string $newValue = false ) : boolean | string | null | Renew or return access token. | |
assetModel_styleCss_handler ( $sender, $args ) | Insert css file for generic styling of signin button/icon. | |
authorizeUri ( array $state = [] ) : string | Create the URI that can return an authorization. | |
base_beforeSignInButton_handler ( $sender, $args ) | Inject a sign-in icon into the ME menu. | |
base_connectData_handler ( $sender, $args ) | Inject into the process of the base connection. | |
entryController_overrideSignIn_handler ( $sender, $args ) : mixed | boolean | Redirect to provider's signin page if this is the default behaviour. | |
entryController_signIn_handler ( $sender, $args ) : mixed | boolean | Inject sign-in button into the sign in page. | |
entryEndpoint ( $sender, $code, $state ) | Create a controller to handle entry request. | |
gdn_pluginManager_afterStart_handler ( $sender ) | Register a call back function so that multiple plugins can use it as an entry point on SSO. | |
getAccessTokenRequestOptions ( ) : array | Allow child classes to pass different options to the Token request API call. | |
getProfile ( ) : array | Get profile data from authentication provider through API. | |
getProfileRequestOptions ( ) : array | Allow child classes to pass different options to the Profile request API call. | |
getProviderKey ( ) : string | Get provider key. | |
isConfigured ( ) : boolean | Check if there is enough data to connect to an authentication provider. | |
isConnected ( ) : boolean | Check if an access token has been returned from the provider server. | |
isDefault ( ) : boolean | Check authentication provider table to see if this is the default method for logging in. | |
log ( $message, $data ) | ||
provider ( ) : array | Return all the information saved in provider table. | |
requestAccessToken ( string $code ) : mixed | Request access token from provider. | |
requireVal ( string $key, array $arr, string $context = null ) : mixed | Extract values from arrays. | |
setAccessToken ( string $accessToken ) | Set access token received from provider. | |
setAuthorizeUriParams ( $params ) | Set additional params to be added to the get string in the AuthorizeUri string. | |
setGetProfileParams ( $params ) | Set additional params to be added to the get string in the getProfile request. | |
setProviderKey ( string $providerKey ) | Set provider key used to access settings stored in GDN_UserAuthenticationProvider. | |
setRequestAccessTokenParams ( $params ) | Set additional params to be added to the post array in the accessToken request. | |
setScope ( $scope ) | Set scope to be passed to provider. | |
settingsEndpoint ( $sender, $args ) | Create a controller to deal with plugin settings in dashboard. | |
setup ( ) | Setup | |
signInButton ( string $type = 'button' ) : string | Create signup button specific to this plugin. | |
structure ( ) | Create the structure in the database. | |
translateProfileResults ( array $rawProfile = [] ) : array | Allow the admin to input the keys that their service uses to send data. |
Method | Description | |
---|---|---|
api ( $uri, string $method = 'GET', array $params = [], array $options = [] ) : mixed | type. | Generic API uses ProxyRequest class to fetch data from remote endpoints. | |
getSettingsFormFields ( ) : array | Allow child class to over-ride or add form fields to settings. |
protected api ( $uri, string $method = 'GET', array $params = [], array $options = [] ) : mixed | type. | ||
$uri | Endpoint on provider's server. | |
$method | string | HTTP method required by provider. |
$params | array | Query string. |
$options | array | Configuration options for the request (e.g. Content-Type). |
return | mixed | type. |
public assetModel_styleCss_handler ( $sender, $args ) |
public authorizeUri ( array $state = [] ) : string | ||
$state | array | Optionally provide an array of variables to be sent to the provider. |
return | string | Endpoint of the provider. |
public base_beforeSignInButton_handler ( $sender, $args ) |
public base_connectData_handler ( $sender, $args ) |
public entryController_overrideSignIn_handler ( $sender, $args ) : mixed | boolean | ||
return | mixed | boolean | Return null if not configured. |
public entryController_signIn_handler ( $sender, $args ) : mixed | boolean | ||
return | mixed | boolean | Return null if not configured |
public entryEndpoint ( $sender, $code, $state ) | ||
$code | string Retrieved from the response of the authentication provider, used to fetch an authentication token. | |
$state | string Values passed by us and returned in the response of the authentication provider. |
public gdn_pluginManager_afterStart_handler ( $sender ) | ||
$sender |
public getAccessTokenRequestOptions ( ) : array | ||
return | array |
public getProfile ( ) : array | ||
return | array | User profile from provider. |
public getProfileRequestOptions ( ) : array | ||
return | array |
public getProviderKey ( ) : string | ||
return | string | Provider key. |
protected getSettingsFormFields ( ) : array | ||
return | array | Form fields to appear in settings dashboard. |
public isConfigured ( ) : boolean | ||
return | boolean | True if there is a secret and a client_id, false if not. |
public isConnected ( ) : boolean | ||
return | boolean | True of there is an accessToken, fals if there is not. |
public requestAccessToken ( string $code ) : mixed | ||
$code | string | code returned from initial handshake with provider. |
return | mixed | Result of the API call to the provider, usually JSON. |
public setAccessToken ( string $accessToken ) | ||
$accessToken | string | Retrieved from provider to authenticate communication. |
public setAuthorizeUriParams ( $params ) |
public setGetProfileParams ( $params ) |
public setProviderKey ( string $providerKey ) | ||
$providerKey | string | Key to retrieve provider data hardcoded into child class. |
public setRequestAccessTokenParams ( $params ) |
public settingsEndpoint ( $sender, $args ) |
public signInButton ( string $type = 'button' ) : string | ||
$type | string | Either button or icon to be output. |
return | string | Resulting HTML element (button). |
public translateProfileResults ( array $rawProfile = [] ) : array | ||
$rawProfile | array | profile as it is returned from the provider. |
return | array | Profile array transformed by child class or as is. |
protected $authorizeUriParams |
protected $profileRequestParams |
protected $provider |
protected $providerKey |
protected $requestAccessTokenParams |