Skip to content

Commit be4b8e3

Browse files
krowvinMikeNeilson
authored andcommitted
Add FINE logging to help identify issuer mismatches
1 parent 9d04625 commit be4b8e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cwms-data-api/src/main/java/cwms/cda/security/OpenIdConnectIdentitityProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ private DataApiPrincipal getUserFromToken(Context ctx) throws CwmsAuthException
115115
throw new CwmsAuthException("Not Authorized",HttpServletResponse.SC_UNAUTHORIZED);
116116
}
117117
} catch (NumberFormatException | JwtException ex) {
118+
log.atFine().withCause(ex).log(
119+
"JWT validation failed for bearer token from issuer configuration '%s'",
120+
System.getProperty(ISSUER_PROPERTY, System.getenv(ISSUER_PROPERTY))
121+
);
118122
throw new CwmsAuthException("JWT not valid",ex,HttpServletResponse.SC_UNAUTHORIZED);
119123
}
120124
}

0 commit comments

Comments
 (0)