From 8fc55bd03d9ae8eeb341bf62af8e25a068fb2a76 Mon Sep 17 00:00:00 2001 From: vvaadd Date: Fri, 10 May 2024 22:24:46 +0300 Subject: [PATCH] Minor code fix --- .../pages/servlet/authentication/passwords/digest.adoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/servlet/authentication/passwords/digest.adoc b/docs/modules/ROOT/pages/servlet/authentication/passwords/digest.adoc index d91b3fd0b8b..962a7523da0 100644 --- a/docs/modules/ROOT/pages/servlet/authentication/passwords/digest.adoc +++ b/docs/modules/ROOT/pages/servlet/authentication/passwords/digest.adoc @@ -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(); } ----