Interface LocalAuthenticationProvider<TestAPI>
- Type Parameters:
TestAPI
- The type of the test interface. Not important for non-test purposes.
- All Superinterfaces:
AuthenticationProvider
- All Known Implementing Classes:
LocalAuthProviderImpl
Locally-defined authentication providers include the capability to create
users.
- Author:
- Donal Fellows
-
Method Summary
Modifier and TypeMethodDescriptionboolean
createUser
(String username, String password, TrustLevel trustLevel) Create a user.void
mapAuthorities
(OidcUserAuthority authority, Collection<GrantedAuthority> resultCollection) Map the authorities, adding them to the result.void
Unlock any locked users whose lock period has expired.updateAuthentication
(jakarta.servlet.http.HttpServletRequest req, SecurityContext ctx) Convert the type of the authentication in the security context.Methods inherited from interface org.springframework.security.authentication.AuthenticationProvider
authenticate, supports
-
Method Details
-
createUser
@PreAuthorize("hasRole(\'ADMIN\')") boolean createUser(String username, String password, TrustLevel trustLevel) Create a user. Only admins can create users.- Parameters:
username
- The user name to use.password
- The unencoded password to use.trustLevel
- How much is the user trusted.- Returns:
- True if the user was created, false if the user already existed.
-
unlockLockedUsers
void unlockLockedUsers()Unlock any locked users whose lock period has expired. -
updateAuthentication
Authentication updateAuthentication(jakarta.servlet.http.HttpServletRequest req, SecurityContext ctx) Convert the type of the authentication in the security context.- Parameters:
req
- The request being made.ctx
- The security context.- Returns:
- The new authentication (which is also installed into the security
context), or
null
if the authentication is not changed.
-
mapAuthorities
Map the authorities, adding them to the result.- Parameters:
authority
- The overall authority to map.resultCollection
- Where to add the authorities.
-