List of usage examples for org.springframework.security.web.authentication HttpStatusEntryPoint HttpStatusEntryPoint
public HttpStatusEntryPoint(HttpStatus httpStatus)
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; }