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