function openid_connect_create_state_token in OpenID Connect / OAuth client 7
Creates a state token and stores it in the session for later validation.
Return value
string A state token that later can be validated to prevent request forgery.
1 call to openid_connect_create_state_token()
- OpenIDConnectClientBase::authorize in includes/
OpenIDConnectClientBase.class.php - Redirects the user to the authorization endpoint.
File
- ./
openid_connect.module, line 180 - A pluggable client implementation for the OpenID Connect protocol.
Code
function openid_connect_create_state_token() {
$state = drupal_random_key();
$_SESSION['openid_connect_state'] = $state;
return $state;
}