io.quarkus.resteasy.runtime.AuthenticationCompletionExceptionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-resteasy Show documentation
Show all versions of quarkus-resteasy Show documentation
REST endpoint framework implementing JAX-RS and more
package io.quarkus.resteasy.runtime;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import org.jboss.logging.Logger;
import io.quarkus.security.AuthenticationCompletionException;
@Provider
public class AuthenticationCompletionExceptionMapper implements ExceptionMapper {
private static final Logger log = Logger.getLogger(AuthenticationCompletionExceptionMapper.class.getName());
@Override
public Response toResponse(AuthenticationCompletionException ex) {
log.debug("Authentication has failed, returning HTTP status 401");
return Response.status(401).build();
}
}