[java-identity-provider] branch maint-4 updated: IDP-2048 - Duo "bad request" exception is missing error detail

Scott Cantor cantor.2 at osu.edu
Wed Dec 7 14:35:31 UTC 2022


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

scantor pushed a commit to branch maint-4
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=27ae3d04fe5037020b703c7c7b6933b6eafe0f16

The following commit(s) were added to refs/heads/maint-4 by this push:
     new 27ae3d04f IDP-2048 - Duo "bad request" exception is missing error detail
27ae3d04f is described below

commit 27ae3d04fe5037020b703c7c7b6933b6eafe0f16
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Dec 7 09:35:28 2022 -0500

    IDP-2048 - Duo "bad request" exception is missing error detail
    
    https://shibboleth.atlassian.net/browse/IDP-2048
---
 .../shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
index c95d89e4f..c077956bf 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/duo/impl/AbstractDuoAuthenticator.java
@@ -139,8 +139,12 @@ public abstract class AbstractDuoAuthenticator extends AbstractInitializableComp
         if (httpStatusCode == HttpStatus.SC_BAD_REQUEST) {
             final InputStream httpContent = httpResponse.getEntity().getContent();
             final DuoFailureResponse msg = objectMapper.readValue(httpContent, DuoFailureResponse.class);
-            throw new DuoWebException(msg.getMessage() != null ? msg.getMessage() : "no message" + "("
-                    + msg.getMessageDetail() != null ? msg.getMessageDetail() : "no detail" + ")");
+            final StringBuilder builder = new StringBuilder();
+            builder.append(msg.getMessage() != null ? msg.getMessage() : "no message")
+                .append(" (")
+                .append(msg.getMessageDetail() != null ? msg.getMessageDetail() : "no detail")
+                .append(")");
+            throw new DuoWebException(builder.toString());
         }
         if (httpStatusCode != HttpStatus.SC_OK) {
             throw new IOException("Non-ok status code (" + httpStatusCode + ") returned from Duo: "

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


More information about the commits mailing list