use of org.opensaml.saml.saml2.core.StatusCode in project verify-hub by alphagov.
the class ProtectiveMonitoringLogger method logAuthnResponse.
public void logAuthnResponse(Response samlResponse, Direction direction, SignatureStatus signatureStatus) {
Map<String, String> copyOfContextMap = Optional.ofNullable(MDC.getCopyOfContextMap()).orElse(Collections.emptyMap());
StatusCode statusCode = samlResponse.getStatus().getStatusCode();
MDC.setContextMap(Map.of("responseId", samlResponse.getID(), "inResponseTo", samlResponse.getInResponseTo(), "status", statusCode.getValue(), "subStatus", Optional.ofNullable(statusCode.getStatusCode()).map(StatusCode::getValue).orElse("NoSubStatus"), "direction", direction.name(), "issuerId", Optional.ofNullable(samlResponse.getIssuer()).map(Issuer::getValue).orElse("NoIssuer"), "destination", Optional.ofNullable(samlResponse.getDestination()).orElse("NoDestination"), "signatureStatus", signatureStatus.name()));
LOG.info(formatter.formatAuthnResponse(samlResponse, direction, signatureStatus));
MDC.clear();
MDC.setContextMap(copyOfContextMap);
}
Aggregations