[KEYCLOAK-7695] Restore token_type and expires_in for implicit flow
As KEYCLOAK-6585 concerns only hybrid flow, this commit restores the behavior for implicit flow. This commit partially reverts #5041 (061049e41a6b0e6fb45c75f05748023ad7ab7d92).
This commit is contained in:
parent
8a7a545628
commit
42553cdc44
2 changed files with 5 additions and 1 deletions
|
@ -910,7 +910,7 @@
|
||||||
supportedParams = ['code', 'state', 'session_state'];
|
supportedParams = ['code', 'state', 'session_state'];
|
||||||
break;
|
break;
|
||||||
case 'implicit':
|
case 'implicit':
|
||||||
supportedParams = ['access_token', 'id_token', 'state', 'session_state'];
|
supportedParams = ['access_token', 'token_type', 'id_token', 'state', 'session_state', 'expires_in'];
|
||||||
break;
|
break;
|
||||||
case 'hybrid':
|
case 'hybrid':
|
||||||
supportedParams = ['access_token', 'id_token', 'code', 'state', 'session_state'];
|
supportedParams = ['access_token', 'id_token', 'code', 'state', 'session_state'];
|
||||||
|
|
|
@ -235,6 +235,10 @@ public class OIDCLoginProtocol implements LoginProtocol {
|
||||||
|
|
||||||
if (responseType.hasResponseType(OIDCResponseType.TOKEN)) {
|
if (responseType.hasResponseType(OIDCResponseType.TOKEN)) {
|
||||||
redirectUri.addParam(OAuth2Constants.ACCESS_TOKEN, res.getToken());
|
redirectUri.addParam(OAuth2Constants.ACCESS_TOKEN, res.getToken());
|
||||||
|
if (responseType.isImplicitFlow()) {
|
||||||
|
redirectUri.addParam("token_type", res.getTokenType());
|
||||||
|
redirectUri.addParam("expires_in", String.valueOf(res.getExpiresIn()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue