Spring Security Workflow

I am new to Spring Security and I cannot understand the main workflow. I read the official documentation again and again, but I feel more embarrassed. I can not understand what exactly:

  • authentication manager / provider
  • authentication object
  • user detail
  • user details

It seems that the authentication object is built thanks to the details of the user, but for the latter it is necessary that the former be built (this is what I understood from the document).

Does anyone have a simple explanation of how all these things are used?

+4
source share
2 answers

Spring AuthenticationManager . , , , .

AuthenticationManager. AuthenticationProvider. AuthenticationProvider - , , .

AuthenticationProvider , UserDetailsService. UserDetailsService UserDetails. UserDetailsService , UsernameNotFoundException. ? UserDetailsService loadUserByUsername ( String). , , , , String .

UserDetailsService UserDetails, AuthenticationProvider , , . , AuthenticationProvider BadCredentialsException, , , , .

, . . , AuthenticationManagers authenticate. AuthenticationProviders, , , . AuthenticationProvider UserDetailsServices loadUserByUserName.

:. , .

UserDetails: - UserDetails , , .

UserDetailsService: - UserDetailsService , () UserDetails. .

+17

(, db db?). , . .

spring, spring, .

[Ref docs]

+2

Source: https://habr.com/ru/post/1536620/


All Articles