Log some details if error happens in CIBA authentication request

Closes #14650
This commit is contained in:
mposolda 2023-02-23 12:22:34 +01:00 committed by Marek Posolda
parent 557a22968c
commit f180115d27
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package org.keycloak.protocol.oidc.grants.ciba.endpoints;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.jboss.logging.Logger;
import org.jboss.resteasy.annotations.cache.NoCache;
import org.keycloak.http.HttpRequest;
import org.keycloak.OAuth2Constants;
@ -61,6 +62,8 @@ import static org.keycloak.protocol.oidc.OIDCLoginProtocol.LOGIN_HINT_PARAM;
public class BackchannelAuthenticationEndpoint extends AbstractCibaEndpoint {
private static final Logger log = Logger.getLogger(BackchannelAuthenticationEndpoint.class);
private final RealmModel realm;
private static final Pattern BINDING_MESSAGE_VALIDATION = Pattern.compile("^[a-zA-Z0-9-._+/!?#]{1,50}$");
@ -116,6 +119,7 @@ public class BackchannelAuthenticationEndpoint extends AbstractCibaEndpoint {
.build();
}
} catch (Exception e) {
log.warn("Unexpected failure when processing CIBA authentication request", e);
throw new ErrorResponseException(OAuthErrorException.SERVER_ERROR, "Failed to send authentication request", Response.Status.SERVICE_UNAVAILABLE);
}