Comments (2)
Duplicate of gh-203
from spring-security-kerberos.
Thanks a lot for the update! I confirm that the following solution within filterChain()
based on your updated sample, is working fine. Since I'm securing a REST server, I don't need login/logout forms. However, I need to disable CSRF to allow POST operations.
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
ProviderManager providerManager = new ProviderManager(kerberosAuthenticationProvider(),
kerberosServiceAuthenticationProvider());
http
.authorizeHttpRequests((authz) -> authz
// do not authenticate clients on the /info endpoint
.requestMatchers("/info").permitAll()
// always permit /error endpoint (default redirect for rendering error messages)
.requestMatchers("/error").permitAll()
// require authentication without role constraint on any other endpoint
.anyRequest().authenticated())
// disabling cross site request forgery filter to allow POST requests
.csrf((csrf) -> csrf.disable())
// exception handling for Kerberos negotiate challenge to the client
.exceptionHandling(((exceptions) -> exceptions
.authenticationEntryPoint(spnegoEntryPoint())))
// add Kerberos authenticator knowing the expected users
.authenticationProvider(kerberosAuthenticationProvider())
// add validator of Kerberos service tickets
.authenticationProvider(kerberosServiceAuthenticationProvider())
// add filter which processes the "Authorization: Negotiate" header sent by the client
// containing the service ticket
.addFilterBefore(
spnegoAuthenticationProcessingFilter(providerManager),
BasicAuthenticationFilter.class);
return http.build();
}
from spring-security-kerberos.
Related Issues (20)
- Update to Spring Security 6.1.9 HOT 1
- Modernize Antora Build HOT 1
- Login issues with Spring Boot 3.3 HOT 5
- Update to assertj 3.26.0
- Update to httpclient 5.3.1
- Update to junit 5.10.2
- Update to Mockito 5.12.0
- Update to okhttp 3.14.9
- Update to servlet-api 6.0.0
- Update to Spring Framework 6.1.8
- Update to Spring Security 6.3.0
- Update to Spring Boot 3.3.0
- Update to io.spring.dependency-management 1.1.5
- Use a Version Catalog
- Use Spring Security Lambda DSL
- Upgrade to Gradle 8.7 HOT 1
- Update to Develocity Plugin
- Update to build-info-extractor-gradle 4.33.16
- cann't get brower side's user using windows auth sample HOT 1
- Release 2.1.0-RC1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-security-kerberos.