UserDetailsService

UserDeatilsService is another core interface in the Spring Security framework that is used to retrieve data related to the user. This obtained information is stored in UserDeatils, which represents the principal. We can get the user information as shown in the following lines of code:

    if(appl_principal instance of UserDetails) 
    { 
      String username=((UserDeatils)app_principal).getUsername(); 
    } 

How will we get the information about which role the users are holding? GrantedAuthority is the answer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.26.176