use of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint in project spring-security-oauth by spring-projects.
the class AuthorizationServerSecurityConfigurer method registerDefaultAuthenticationEntryPoint.
@SuppressWarnings("unchecked")
private void registerDefaultAuthenticationEntryPoint(HttpSecurity http) {
ExceptionHandlingConfigurer<HttpSecurity> exceptionHandling = http.getConfigurer(ExceptionHandlingConfigurer.class);
if (exceptionHandling == null) {
return;
}
if (authenticationEntryPoint == null) {
BasicAuthenticationEntryPoint basicEntryPoint = new BasicAuthenticationEntryPoint();
basicEntryPoint.setRealmName(realm);
authenticationEntryPoint = basicEntryPoint;
}
ContentNegotiationStrategy contentNegotiationStrategy = http.getSharedObject(ContentNegotiationStrategy.class);
if (contentNegotiationStrategy == null) {
contentNegotiationStrategy = new HeaderContentNegotiationStrategy();
}
MediaTypeRequestMatcher preferredMatcher = new MediaTypeRequestMatcher(contentNegotiationStrategy, MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON, MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_XML, MediaType.MULTIPART_FORM_DATA, MediaType.TEXT_XML);
preferredMatcher.setIgnoredMediaTypes(Collections.singleton(MediaType.ALL));
exceptionHandling.defaultAuthenticationEntryPointFor(postProcess(authenticationEntryPoint), preferredMatcher);
}
use of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint in project promregator by promregator.
the class BasicAuthenticationSpringConfiguration method basicAuthEntryPoint.
@Bean
public BasicAuthenticationEntryPoint basicAuthEntryPoint() {
BasicAuthenticationEntryPoint bauth = new BasicAuthenticationEntryPoint();
bauth.setRealmName("Promregator");
return bauth;
}
use of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint in project atlas by apache.
the class AtlasSecurityConfig method getAuthenticationEntryPoint.
public BasicAuthenticationEntryPoint getAuthenticationEntryPoint() {
BasicAuthenticationEntryPoint basicAuthenticationEntryPoint = new BasicAuthenticationEntryPoint();
basicAuthenticationEntryPoint.setRealmName("atlas.com");
return basicAuthenticationEntryPoint;
}
use of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint in project pivotal-cla by pivotalsoftware.
the class SecurityConfig method entryPoint.
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;
}
use of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint in project incubator-atlas by apache.
the class AtlasSecurityConfig method getAuthenticationEntryPoint.
public BasicAuthenticationEntryPoint getAuthenticationEntryPoint() {
BasicAuthenticationEntryPoint basicAuthenticationEntryPoint = new BasicAuthenticationEntryPoint();
basicAuthenticationEntryPoint.setRealmName("atlas.com");
return basicAuthenticationEntryPoint;
}
Aggregations