Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,15 @@ public Uni<SecurityIdentity> apply(final AuthorizationCodeTokens tokens, final T
if (isIdTokenRequired(configContext)) {
LOG.errorf("ID token is not available in the authorization code grant response");
return Uni.createFrom().failure(new AuthenticationCompletionException());
} else {
} else if (tokens.getAccessToken() != null) {
tokens.setIdToken(generateInternalIdToken(configContext, null, null,
tokens.getAccessTokenExpiresIn()));
internalIdToken = true;
} else {
LOG.errorf(
"Neither ID token nor access tokens are available in the authorization code grant response."
+ " Please check logs for more details, enable debug log level if no details are visible.");
return Uni.createFrom().failure(new AuthenticationCompletionException());
}
} else {
if (!prepareNonceForVerification(context, configContext.oidcConfig(), stateBean)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ private Uni<UserInfo> getUserInfoUni(Map<String, Object> requestData, TokenAuthe

LOG.debug("Requesting UserInfo");
String contextAccessToken = (String) requestData.get(OidcConstants.ACCESS_TOKEN_VALUE);
if (contextAccessToken == null && isIdToken(request)) {
throw new AuthenticationCompletionException(
"Authorization code flow access token which is required to get UserInfo is missing");
}
final String accessToken = contextAccessToken != null ? contextAccessToken : request.getToken().getToken();

UserInfoCache userInfoCache = tenantResolver.getUserInfoCache();
Expand Down
Loading