You are here

class OpenIDConnectClientGeneric in OpenID Connect / OAuth client 7

Implements generic OpenID Connect Client plugin.

Hierarchy

Expanded class hierarchy of OpenIDConnectClientGeneric

1 string reference to 'OpenIDConnectClientGeneric'
generic.inc in plugins/openid_connect_client/generic/generic.inc

File

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

View source
class OpenIDConnectClientGeneric extends OpenIDConnectClientBase {

  /**
   * {@inheritdoc}
   */
  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;
  }

  /**
   * {@inheritdoc}
   */
  public function getEndpoints() {
    return array(
      'authorization' => $this
        ->getSetting('authorization_endpoint'),
      'token' => $this
        ->getSetting('token_endpoint'),
      'userinfo' => $this
        ->getSetting('userinfo_endpoint'),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OpenIDConnectClientBase::$label protected property The human-readable name of the client plugin.
OpenIDConnectClientBase::$name protected property The machine name of the client plugin.
OpenIDConnectClientBase::$settings protected property Admin-provided configuration.
OpenIDConnectClientBase::authorize public function Redirects the user to the authorization endpoint. Overrides OpenIDConnectClientInterface::authorize
OpenIDConnectClientBase::decodeIdToken public function Decodes ID token to access user data. Overrides OpenIDConnectClientInterface::decodeIdToken
OpenIDConnectClientBase::getLabel public function Get the client's human-readable label. Overrides OpenIDConnectClientInterface::getLabel
OpenIDConnectClientBase::getName public function Get the client's machine name. Overrides OpenIDConnectClientInterface::getName
OpenIDConnectClientBase::getSetting public function Returns the value of a setting. Overrides OpenIDConnectClientInterface::getSetting
OpenIDConnectClientBase::retrieveTokens public function Retrieve access token and ID token. Overrides OpenIDConnectClientInterface::retrieveTokens
OpenIDConnectClientBase::retrieveUserInfo public function Retrieves user info: additional user profile data. Overrides OpenIDConnectClientInterface::retrieveUserInfo 1
OpenIDConnectClientBase::settingsFormSubmit public function Handles the submitted settings form. Overrides OpenIDConnectClientInterface::settingsFormSubmit
OpenIDConnectClientBase::settingsFormValidate public function Validates the settings form. Overrides OpenIDConnectClientInterface::settingsFormValidate
OpenIDConnectClientBase::__construct public function Constructs a new OpenIDConnectClientBase.
OpenIDConnectClientGeneric::getEndpoints public function Returns an array of endpoints. Overrides OpenIDConnectClientBase::getEndpoints
OpenIDConnectClientGeneric::settingsForm public function Returns the settings form. Overrides OpenIDConnectClientBase::settingsForm