|
@@ -46,16 +46,18 @@ Java::
|
|
|
@Autowired
|
|
|
UserDetailsService userDetailsService;
|
|
|
|
|
|
-DigestAuthenticationEntryPoint entryPoint() {
|
|
|
+DigestAuthenticationEntryPoint authenticationEntryPoint() {
|
|
|
DigestAuthenticationEntryPoint result = new DigestAuthenticationEntryPoint();
|
|
|
result.setRealmName("My App Realm");
|
|
|
result.setKey("3028472b-da34-4501-bfd8-a355c42bdf92");
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
DigestAuthenticationFilter digestAuthenticationFilter() {
|
|
|
DigestAuthenticationFilter result = new DigestAuthenticationFilter();
|
|
|
result.setUserDetailsService(userDetailsService);
|
|
|
- result.setAuthenticationEntryPoint(entryPoint());
|
|
|
+ result.setAuthenticationEntryPoint(authenticationEntryPoint());
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Bean
|
|
@@ -63,7 +65,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
|
http
|
|
|
// ...
|
|
|
.exceptionHandling(e -> e.authenticationEntryPoint(authenticationEntryPoint()))
|
|
|
- .addFilterBefore(digestFilter());
|
|
|
+ .addFilter(digestAuthenticationFilter());
|
|
|
return http.build();
|
|
|
}
|
|
|
----
|