From 0d4749025e2c39c521de883ec1f6c9ce8a90b55d Mon Sep 17 00:00:00 2001 From: YuriyZ Date: Thu, 10 Feb 2022 12:24:09 +0200 Subject: [PATCH] fix(jans-auth-server): fixed error code during error response creation https://github.com/JanssenProject/jans/issues/795 --- .../java/io/jans/as/server/par/ws/rs/ParRestWebService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/par/ws/rs/ParRestWebService.java b/jans-auth-server/server/src/main/java/io/jans/as/server/par/ws/rs/ParRestWebService.java index e1134a46c54..5715822ffef 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/par/ws/rs/ParRestWebService.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/par/ws/rs/ParRestWebService.java @@ -204,6 +204,7 @@ private ErrorResponse createErrorResponseFromRedirectErrorUri(@NotNull URI locat final ErrorResponse response = new ErrorResponse(); + String error = locationRedirect.getResponseParameter("error"); String errorDescription = locationRedirect.getResponseParameter("error_description"); errorDescription = Optional.ofNullable(errorDescription) .map(description -> Optional.ofNullable(ThreadContext.get(Constants.CORRELATION_ID_HEADER)) @@ -211,7 +212,7 @@ private ErrorResponse createErrorResponseFromRedirectErrorUri(@NotNull URI locat .orElse(description)) .orElse(null); - response.setErrorCode(errorDescription); + response.setErrorCode(error); response.setErrorDescription(errorDescription); return response; }