You are here

function auth0_install in Auth0 Single Sign On 8.2

Same name and namespace in other branches
  1. 8 auth0.install \auth0_install()

Implements hook_install().

File

./auth0.install, line 44
Installation file for the auth0 module.

Code

function auth0_install() {
  $css = "\n#a0-widget .a0-panel {\n    min-width: 90%;\n    padding: 5%;\n    box-shadow: none;\n    -webkit-box-shadow: none;\n}\n#a0-widget .a0-panel {\n    background-color: #f6f6f2;\n    border-color: #f9f9f9;\n}";
  $config = \Drupal::service('config.factory')
    ->getEditable('auth0.settings');
  $config
    ->set('auth0_form_title', 'Sign In')
    ->set('auth0_allow_signup', TRUE)
    ->set('auth0_allow_offline_access', FALSE)
    ->set('auth0_redirect_for_sso', TRUE)
    ->set('auth0_widget_cdn', '//cdn.auth0.com/js/lock/11.15/lock.min.js')
    ->set('auth0_requires_verified_email', TRUE)
    ->set('auth0_join_user_by_mail_enabled', TRUE)
    ->set('auth0_username_claim', 'nickname')
    ->set('auth0_login_css', $css)
    ->set('auth0_auto_register', FALSE)
    ->set('auth0_lock_extra_settings', '')
    ->set('auth0_claim_mapping', '')
    ->set('auth0_claim_to_use_for_role', '')
    ->set('auth0_role_mapping', '')
    ->save();
}