Provider#

Whenever you're dealing with a provider in your template, you're actually working with a Provider object.

Attributes#

AttributeDescription
nameThe name of the provider.
handleThe handle of the provider.
enabledWhether the provider is enabled.
primaryColorThe primary brand color of the provider.
iconThe SVG icon of the provider.
loginEnabledWhether the provider is enabled for login.
cpLoginEnabledWhether the provider is enabled for control panel login.
matchUserSourceThe handle of the field (from the provider API) to use when matching an existing Craft user.
matchUserDestinationThe handle of the field (in Craft) to use when matching an existing Craft user.
fieldMappingA definition for how provider API fields should map to Craft user fields.
authorizationOptionsA collection of options use in the Authorization URL.
scopesA collection of scopes use in the Authorization URL.
customProfileFieldsA collection of custom fields to be included alongside default ones.

Methods#

MethodDescription
getToken()Returns the OAuth access token.

OAuth Provider#

Most, if not all providers use the Auth (opens new window) plugin to handle the bulk of authentication work. As such, they inherit those classes.

Attributes#

AttributeDescription
clientIdThe OAuth client ID.
clientSecretThe OAuth client secret.

Methods#

MethodDescription
getOAuthVersion()The OAuth version (1 or 2).
getIsOAuth1()Whether is OAuth 1.
getIsOAuth2()Whether is OAuth 2.
getOAuthProviderConfig()Returns an array of config for the OAuth provider.
getOAuthProvider()Returns the OAuth provider.
getAuthorizationUrlOptions()The array of options for the Authorization URL.
getAuthorizationUrl()The Authorization URL used to redirect to the provider.
getAccessToken()Fetches the access token from the provider upon callback.
request(method, uri, options)Returns the result from an authenticated API request.

Previous ← Login Form Next Custom Provider →