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

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


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

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

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

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

commit 30c2ed964fb7b1ec7c0e60bf155dc78e09b75ca3
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 8e9cef9d7..ee765f422 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
@@ -131,8 +131,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