All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.boot.support.APIBasicAuthenticationEntryPoint Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.boot.support;

import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Component("APIBasicAuthenticationEntryPoint")
public class APIBasicAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {

    public APIBasicAuthenticationEntryPoint() {
        setRealmName("ontrack");
    }

    @Override
    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
        // Does nothing...
        response.sendError(HttpServletResponse.SC_FORBIDDEN, authException.getMessage());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy