Example usage for org.springframework.security.web.authentication HttpStatusEntryPoint HttpStatusEntryPoint

List of usage examples for org.springframework.security.web.authentication HttpStatusEntryPoint HttpStatusEntryPoint

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication HttpStatusEntryPoint HttpStatusEntryPoint.

Prototype

public HttpStatusEntryPoint(HttpStatus httpStatus) 

Source Link

Document

Creates a new instance.

Usage

From source file:io.pivotal.cla.config.SecurityConfig.java

private AuthenticationEntryPoint entryPoint() {
    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<>();
    entryPoints.put(new AntPathRequestMatcher("/github/hooks/**"),
            new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED));
    entryPoints.put(new AntPathRequestMatcher("/admin/**"), new GitHubAuthenticationEntryPoint(
            oauthConfig.getMain(), "user:email,repo:status,admin:repo_hook,admin:org_hook,read:org"));
    BasicAuthenticationEntryPoint basicEntryPoint = new BasicAuthenticationEntryPoint();
    basicEntryPoint.setRealmName("Pivotal CLA");
    entryPoints.put(new AntPathRequestMatcher("/manage/**"), basicEntryPoint);
    DelegatingAuthenticationEntryPoint entryPoint = new DelegatingAuthenticationEntryPoint(entryPoints);
    entryPoint.setDefaultEntryPoint(new GitHubAuthenticationEntryPoint(oauthConfig.getMain(), "user:email"));
    return entryPoint;
}