You are here

function oauth2_login_get_oauth2_settings in OAuth2 Login 8

Same name and namespace in other branches
  1. 7.2 oauth2_login.module \oauth2_login_get_oauth2_settings()
  2. 7.2 oauth2_login.api.php \oauth2_login_get_oauth2_settings()

Return oauth2 settings.

2 calls to oauth2_login_get_oauth2_settings()
oauth2_login_get_access_token in ./oauth2_login.api.php
Get an access_token, or NULL if there is no valid token.
oauth2_user_default_wsclient_service in oauth2_user/wsclient.inc
Implements hook_default_wsclient_service().

File

./oauth2_login.api.php, line 74
The programing interface provided by the module oauth2_login.

Code

function oauth2_login_get_oauth2_settings() {
  $server_url = variable_get('oauth2_login_oauth2_server');
  $oauth2_settings = [
    'auth_flow' => 'server-side',
    'authorization_endpoint' => $server_url . '/oauth2/authorize',
    'token_endpoint' => $server_url . '/oauth2/token',
    'client_id' => variable_get('oauth2_login_client_id'),
    'client_secret' => variable_get('oauth2_login_client_secret'),
    'redirect_uri' => url('oauth2/authorized', [
      'absolute' => TRUE,
    ]),
    'scope' => 'user_profile',
  ];
  return $oauth2_settings;
}