Skip to content

Commit

Permalink
address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SachiniSiriwardene committed Oct 26, 2023
1 parent f524e6f commit 2f45607
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4389,11 +4389,8 @@ private void checkPARMandatory(OAuth2Parameters params, OAuthMessage oAuthMessag
throw new InvalidRequestException(e.getMessage(), e.getErrorCode());
}
if (oAuthAppDO.isRequirePushedAuthorizationRequests()) {
Optional<Object> isPARMandated = Optional.ofNullable(oAuthMessage.getRequest()
.getAttribute(OAuthConstants.IS_PUSH_AUTHORIZATION_REQUEST));

if (isPARMandated.isPresent() &&
Boolean.FALSE.equals(Boolean.parseBoolean(isPARMandated.get().toString()))) {
if (!Boolean.TRUE.equals(oAuthMessage.getRequest()
.getAttribute(OAuthConstants.IS_PUSH_AUTHORIZATION_REQUEST))) {
throw new InvalidRequestException("PAR request is mandatory for the application.",
OAuth2ErrorCodes.INVALID_REQUEST,
OAuth2ErrorCodes.OAuth2SubErrorCodes.INVALID_AUTHORIZATION_REQUEST);
Expand Down

0 comments on commit 2f45607

Please sign in to comment.