public function OpenIDConnectGenericClient::submitConfigurationForm in OpenID Connect / OAuth client 2.x
Form submission handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides OpenIDConnectClientBase::submitConfigurationForm
File
- src/
Plugin/ OpenIDConnectClient/ OpenIDConnectGenericClient.php, line 122
Class
- OpenIDConnectGenericClient
- Generic OAuth 2.0 OpenID Connect client.
Namespace
Drupal\openid_connect\Plugin\OpenIDConnectClientCode
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$configuration = $form_state
->getValues();
if ($configuration['use_well_known']) {
$endpoints = $this
->autoDiscoverEndpoints($configuration['issuer_url']);
$this
->setConfiguration([
'authorization_endpoint' => $endpoints['authorization_endpoint'],
'token_endpoint' => $endpoints['token_endpoint'],
'userinfo_endpoint' => $endpoints['userinfo_endpoint'],
]);
}
// Don't store use_well_known in the configuration, as it is set using the
// value of the issuer_url setting.
$this
->unsetConfigurationKeys([
'use_well_known',
]);
if (!empty($configuration['scopes'])) {
$this
->setConfiguration([
'scopes' => explode(' ', $configuration['scopes']),
]);
}
parent::submitConfigurationForm($form, $form_state);
}