Skip to content

Commit

Permalink
clear out authn profile for oidc when scopes are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Jul 21, 2023
1 parent ce58855 commit cedfa00
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Principal filter(final Service service,
LOGGER.warn("Request does not indicate a scope [{}] that can identify an OpenID Connect request. "
+ "This is a REQUIRED scope that MUST be present in the request. Given its absence, "
+ "CAS will not process any attribute claims and will return the authenticated principal as is.", scopes);
return principal;
return principalFactory.createPrincipal(profile.getId());
}

scopes.retainAll(casProperties.getAuthn().getOidc().getDiscovery().getScopes());
Expand All @@ -77,7 +77,7 @@ public Principal filter(final Service service,

filterAttributesByAccessTokenRequestedClaims(oidcService, accessToken, principal, attributes);
LOGGER.debug("Final collection of attributes are [{}]", attributes);
return this.principalFactory.createPrincipal(profile.getId(), attributes);
return principalFactory.createPrincipal(profile.getId(), attributes);
}
return principal;
}
Expand Down

0 comments on commit cedfa00

Please sign in to comment.