auth0.module in Auth0 Single Sign On 8.2
Same filename and directory in other branches
Module definition
File
auth0.moduleView source
<?php
/**
* @file
* Module definition
*/
define('AUTH0_DEFAULT_SCOPES', 'openid email profile');
define('AUTH0_DEFAULT_SIGNING_ALGORITHM', 'RS256');
define('AUTH0_DEFAULT_USERNAME_CLAIM', 'nickname');
define('AUTH0_MODULE_VERSION', '8.x-2.4');
/**
* Replace a form with the lock widget.
*/
function auth0_theme() {
return [
'auth0_login' => [
'template' => 'auth0-login',
'variables' => [
'loginCSS' => NULL,
],
],
];
}
/**
* Handle users deletion, it should delete the Auth0 profile.
*/
function auth0_user_delete($account) {
db_delete('auth0_user')
->condition('drupal_id', $account->uid->value)
->execute();
}
/**
* Use Refresh Token.
*/
function auth0_signin_with_refresh_token($token) {
$helper = \Drupal::service('auth0.helper');
return $helper
->getUserUsingRefreshToken($token);
}
/**
* Implements hook_library_info_build().
*/
function auth0_library_info_build() {
$config = \Drupal::service('config.factory')
->get('auth0.settings');
return [
'auth0.widget' => [
'js' => [
$config
->get('auth0_widget_cdn') => [
'type' => 'external',
],
],
],
];
}
Functions
Name | Description |
---|---|
auth0_library_info_build | Implements hook_library_info_build(). |
auth0_signin_with_refresh_token | Use Refresh Token. |
auth0_theme | Replace a form with the lock widget. |
auth0_user_delete | Handle users deletion, it should delete the Auth0 profile. |
Constants
Name | Description |
---|---|
AUTH0_DEFAULT_SCOPES | @file Module definition |
AUTH0_DEFAULT_SIGNING_ALGORITHM | |
AUTH0_DEFAULT_USERNAME_CLAIM | |
AUTH0_MODULE_VERSION |