Skip to content

Spring Framework Blog

Menu
  • Home
  • Spring
  • Spring Boot
  • About
Menu

Spring Security Entities

Posted on June 2, 2024June 14, 2024 by Armando Marques

Table of Contents

Toggle
  • AuthenticationManager
  • ProviderManager
  • AuthenticationProvider
  • DaoAuthenticationProvider
  • Principal
  • Authentication
  • SecurityContext
  • SecurityContextHolder
  • UserDetails
  • UserDetailsService
  • UserDetailsManager

AuthenticationManager

Processes an Authentication request.

Authentication authenticate(Authentication authentication) throws AuthenticationException;

ProviderManager

Iterates an Authentication request through a list of AuthenticationProviders. Hierarchy of classes.

public class ProviderManager implements AuthenticationManager

AuthenticationProvider

Indicates a class can process a specific Authentication implementation.

Authentication authenticate(Authentication authentication) throws AuthenticationException;
boolean supports(Class<?> authentication);

DaoAuthenticationProvider

DaoAuthenticationProvider is an AuthenticationProvider implementation that uses a UserDetailsService and PasswordEncoder to authenticate a username and password.

protected UserDetailsService getUserDetailsService()

protected PasswordEncoder getPasswordEncoder()
protected UserDetailsService getUserDetailsService()

Principal

This interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id.

 public String getName();

Authentication

Represents the token for an authentication request or for an authenticated principal once the request has been processed by the AuthenticationManager.authenticate(Authentication) method.

Collection<? extends GrantedAuthority> getAuthorities();
Object getCredentials();
Object getDetails();
Object getPrincipal();

SecurityContext

Interface defining the minimum security information associated with the current thread of execution.

Authentication getAuthentication();

SecurityContextHolder

Associates a given SecurityContext with the current execution thread.

public static SecurityContext getContext()

UserDetails

Provides core user information.

Collection<? extends GrantedAuthority> getAuthorities();
String getPassword();
String getUsername();
boolean isAccountNonExpired();
boolean isAccountNonLocked();
boolean isCredentialsNonExpired();
boolean isEnabled();

UserDetailsService

Core interface which loads user-specific data.

UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;

UserDetailsManager

An extension of the UserDetailsService which provides the ability to create new users and update existing ones.

void createUser(UserDetails user);
void updateUser(UserDetails user);
void deleteUser(String username);
void changePassword(String oldPassword, String newPassword);
boolean userExists(String username);
  • Spring
  • Documentation
  • References
  • Toc
  • Books
  • Certification
  • AOP
  • Config
  • Java
  • Java core
  • JDBC
  • JPA
  • Rest
  • Security
  • Spring
  • Spring Boot
  • Spring Core
  • Spring Data
  • Spring MVC
  • Spring Rest
  • Spring Security
  • Tests
  • Transactions
  • Uncategorized

Recent Posts

  • Spring Annotations
  • Java Tests
  • Java operators
  • Java versions
  • Java Oracle Licenses
  • Configuration properties
  • MockMvc
  • Spring Security III
  • MVC Controller Method Params
  • JPA Methods
  • Transaction propagation and isolation
  • Spring JDBC
  • Spring Boot Auto-Configuration
  • Spring Resource interface
  • JSR 330 Standard Annotations
  • Spring Aware Interfaces
  • Spring Transactions
  • Spring Boot Core
  • MVC Rest
  • Spring Boot JPA
©2025 Spring Framework Blog | Built using WordPress and Responsive Blogily theme by Superb