You are here

public function OpenIDConnectClientGeneric::settingsForm in OpenID Connect / OAuth client 7

Returns the settings form.

The client settings form is embedded into the module's main settings form, and the configured values are injected into the client class through the constructor.

Overrides OpenIDConnectClientBase::settingsForm

File

plugins/openid_connect_client/generic/OpenIDConnectClientGeneric.class.php, line 19
Generic OpenID Connect client.

Class

OpenIDConnectClientGeneric
Implements generic OpenID Connect Client plugin.

Code

public function settingsForm() {
  $form = parent::settingsForm();
  $default_site = 'https://example.com/oauth2';
  $form['authorization_endpoint'] = array(
    '#title' => t('Authorization endpoint'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('authorization_endpoint', $default_site . '/authorize'),
  );
  $form['token_endpoint'] = array(
    '#title' => t('Token endpoint'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('token_endpoint', $default_site . '/token'),
  );
  $form['userinfo_endpoint'] = array(
    '#title' => t('UserInfo endpoint'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('userinfo_endpoint', $default_site . '/UserInfo'),
  );
  return $form;
}