From 1d4b53babb95c894f7dcb1eedb14c7e031edaa1f Mon Sep 17 00:00:00 2001 From: YuriyZ Date: Fri, 28 Jan 2022 16:46:06 +0200 Subject: [PATCH] fix(jans-auth-server): corrected jarm error response https://github.com/JanssenProject/jans/issues/728 --- .../ws/rs/AuthorizeRestWebServiceImpl.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeRestWebServiceImpl.java b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeRestWebServiceImpl.java index 1b7b3082c48..a9b47fbd58c 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeRestWebServiceImpl.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ws/rs/AuthorizeRestWebServiceImpl.java @@ -792,14 +792,11 @@ private ResponseMode extractResponseMode(String request) { private void fillRedirectUriResponseforJARM(RedirectUriResponse redirectUriResponse, Jwt jwt, Client client) { try { - if (jwt == null) { - return; - } - - JwtClaims jwtClaims = jwt.getClaims(); - String tempRedirectUri = jwtClaims.getClaimAsString("redirect_uri"); - if (tempRedirectUri != null) { - redirectUriResponse.getRedirectUri().setBaseRedirectUri(URLDecoder.decode(tempRedirectUri, "UTF-8")); + if (jwt != null) { + String tempRedirectUri = jwt.getClaims().getClaimAsString("redirect_uri"); + if (StringUtils.isNotBlank(tempRedirectUri)) { + redirectUriResponse.getRedirectUri().setBaseRedirectUri(URLDecoder.decode(tempRedirectUri, "UTF-8")); + } } redirectUriResponse.getRedirectUri().setResponseMode(ResponseMode.JWT); String clientId = client.getClientId();