OpenIDConnectGenericClient.php in OpenID Connect / OAuth client 8
File
src/Plugin/OpenIDConnectClient/OpenIDConnectGenericClient.php
View source
<?php
namespace Drupal\openid_connect\Plugin\OpenIDConnectClient;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openid_connect\Plugin\OpenIDConnectClientBase;
class OpenIDConnectGenericClient extends OpenIDConnectClientBase {
public function defaultConfiguration() {
return [
'authorization_endpoint' => '',
'token_endpoint' => '',
'userinfo_endpoint' => '',
] + parent::defaultConfiguration();
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$form['authorization_endpoint'] = [
'#title' => $this
->t('Authorization endpoint'),
'#type' => 'textfield',
'#default_value' => $this->configuration['authorization_endpoint'],
];
$form['token_endpoint'] = [
'#title' => $this
->t('Token endpoint'),
'#type' => 'textfield',
'#default_value' => $this->configuration['token_endpoint'],
];
$form['userinfo_endpoint'] = [
'#title' => $this
->t('UserInfo endpoint'),
'#type' => 'textfield',
'#default_value' => $this->configuration['userinfo_endpoint'],
];
return $form;
}
public function getEndpoints() {
return [
'authorization' => $this->configuration['authorization_endpoint'],
'token' => $this->configuration['token_endpoint'],
'userinfo' => $this->configuration['userinfo_endpoint'],
];
}
}