Skip to content
Snippets Groups Projects
Commit 0199dfee authored by João Ventura's avatar João Ventura Committed by Joao Ventura
Browse files

Issue #3166501 by jcnventura: Support authorization_code flow without id_token

parent 21bd2ae2
No related branches found
Tags 2.0.0-alpha6
No related merge requests found
......@@ -243,9 +243,20 @@ class OpenIDConnect {
*/
private function buildContext(OpenIDConnectClientEntityInterface $client, array $tokens) {
$plugin = $client->getPlugin();
$user_data = $tokens['id_token'] ?? [];
$access_data = $tokens['access_token'] ?? [];
$userinfo = $plugin->usesUserInfo() ? $plugin->retrieveUserInfo($tokens['access_token']) : array_merge($access_data, $user_data);
$user_data = $tokens['id_token'];
$access_data = $tokens['access_token'];
if ($plugin->usesUserInfo()) {
$userinfo = $plugin->retrieveUserInfo($tokens['access_token']);
}
elseif (is_array($user_data)) {
$userinfo = $user_data;
}
elseif (is_array($access_data)) {
$userinfo = $access_data;
}
else {
$userinfo = [];
}
$provider = $client->getPluginId();
$context = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment