871 event.detail(Details.TOKEN_ID,
accessToken.getId());
875 if (
event.getEvent().getDetails().containsKey(Details.REFRESH_TOKEN_ID)) {
876 event.detail(Details.UPDATED_REFRESH_TOKEN_ID,
refreshToken.getId());
878 event.detail(Details.REFRESH_TOKEN_ID,
refreshToken.getId());
880 event.detail(Details.REFRESH_TOKEN_TYPE,
refreshToken.getType());
883 AccessTokenResponse res =
new AccessTokenResponse();
887 res.setToken(encodedToken);
888 res.setTokenType(
"bearer");
889 res.setSessionState(
accessToken.getSessionState());
891 res.setExpiresIn(
accessToken.getExpiration() - Time.currentTime());
896 String atHash = HashProvider.oidcHash(
session.tokens().signatureAlgorithm(TokenCategory.ID), res.getToken());
897 idToken.setAccessTokenHash(atHash);
909 res.setIdToken(encodedToken);
913 res.setRefreshToken(encodedToken);
915 res.setRefreshExpiresIn(
refreshToken.getExpiration() - Time.currentTime());
919 int notBefore =
realm.getNotBefore();
920 if (
client.getNotBefore() > notBefore) notBefore =
client.getNotBefore();
922 if (userNotBefore > notBefore) notBefore = userNotBefore;
923 res.setNotBeforePolicy(notBefore);
927 res.setScope(responseScope);
928 event.detail(Details.SCOPE, responseScope);
EventBuilder event
Definition: TokenManager.java:748
String stateHash
Definition: TokenManager.java:760
AccessToken accessToken
Definition: TokenManager.java:753
IDToken idToken
Definition: TokenManager.java:755
ClientSessionContext clientSessionCtx
Definition: TokenManager.java:751
AccessTokenResponseBuilder generateAccessTokenHash()
Definition: TokenManager.java:852
KeycloakSession session
Definition: TokenManager.java:749
RefreshToken refreshToken
Definition: TokenManager.java:754
UserSessionModel userSession
Definition: TokenManager.java:750
ClientModel client
Definition: TokenManager.java:747
RealmModel realm
Definition: TokenManager.java:746
String codeHash
Definition: TokenManager.java:758