[java-idp-oidc] branch main updated: JCOMOIDC-197 - JSONErrorResponse returns true for indicatesSuccess

Codeberg noreply at shibboleth.net
Fri Nov 27 16:25:38 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-oidc/commit/6c7ac60f24f88aaf18427a7273688cefa83f096e

The following commit(s) were added to refs/heads/main by this push:
     new 6c7ac60f JCOMOIDC-197 - JSONErrorResponse returns true for indicatesSuccess
6c7ac60f is described below

commit 6c7ac60f24f88aaf18427a7273688cefa83f096e
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Nov 27 16:24:21 2026 +0000

    JCOMOIDC-197 - JSONErrorResponse returns true for indicatesSuccess
    
     - Change indicateSuccess to return false, as this is an error response
     - Guard against a Nimbus ErrorObject from returning a 0 HTTP status
    code, add 400 if it does.
    
    https://shibboleth.atlassian.net/browse/JCOMOIDC-197
---
 .../idp/plugin/oidc/op/messaging/JSONErrorResponse.java      | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/JSONErrorResponse.java b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/JSONErrorResponse.java
index 2486a96b..ea783724 100644
--- a/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/JSONErrorResponse.java
+++ b/idp-oidc-extension-api/src/main/java/net/shibboleth/idp/plugin/oidc/op/messaging/JSONErrorResponse.java
@@ -32,13 +32,13 @@ import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
 public class JSONErrorResponse implements ErrorResponse {
 
     /** Error object. */
-    private ErrorObject error;
+    private final ErrorObject error;
 
     /** cache control value. */
-    private String cacheControl;
+    private final String cacheControl;
 
     /** pragma value. */
-    private String pragma;
+    private final String pragma;
 
     /**
      * Constructor.
@@ -69,7 +69,7 @@ public class JSONErrorResponse implements ErrorResponse {
     /** {@inheritDoc} */
     @Override
     public boolean indicatesSuccess() {
-        return true;
+        return false;
     }
 
     /**
@@ -95,7 +95,9 @@ public class JSONErrorResponse implements ErrorResponse {
     /** {@inheritDoc} */
     @Override
     public HTTPResponse toHTTPResponse() {
-        final HTTPResponse httpResponse = new HTTPResponse(error.getHTTPStatusCode());
+        final int statusCode = error.getHTTPStatusCode();
+        final HTTPResponse httpResponse =
+           new HTTPResponse(statusCode > 0 ? statusCode : HTTPResponse.SC_BAD_REQUEST);
         httpResponse.setEntityContentType(ContentType.APPLICATION_JSON);
         if (cacheControl != null) {
             httpResponse.setCacheControl(cacheControl);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list