Skip to content

Commit

Permalink
fix(oxauth): minor improvements - do not sent claims with null values #…
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Aug 2, 2024
1 parent 738ce7c commit 14f72c2
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,16 @@ private AuthorizationGrant validateAuthorization(String p_authorization, String
if (authorizationGrant == null) {
log.debug("Authorization grant is null.");
if (isTrue(pair.getSecond())) {
final IntrospectionResponse response = new IntrospectionResponse(false);
throw new WebApplicationException(Response.status(Response.Status.OK).entity(ServerUtil.asJson(response)).type(MediaType.APPLICATION_JSON_TYPE).build());
log.debug("Returned {\"active\":false.");
throw new WebApplicationException(Response.status(Response.Status.OK)
.entity("{\"active\":false")
.type(MediaType.APPLICATION_JSON_TYPE)
.build());
}
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).type(MediaType.APPLICATION_JSON_TYPE).entity(errorResponseFactory.errorAsJson(AuthorizeErrorResponseType.ACCESS_DENIED, "Authorization grant is null.")).build());
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED)
.type(MediaType.APPLICATION_JSON_TYPE)
.entity(errorResponseFactory.errorAsJson(AuthorizeErrorResponseType.ACCESS_DENIED, "Authorization grant is null."))
.build());
}

final AbstractToken authorizationAccessToken = authorizationGrant.getAccessToken(tokenService.getToken(p_authorization));
Expand Down

0 comments on commit 14f72c2

Please sign in to comment.