Interface AuthenticationManager
- All Known Implementing Classes:
AuthenticationManagerImpl
public interface AuthenticationManager
Manages authentication.
- Author:
- avasquez
-
Method Summary
Modifier and TypeMethodDescriptionauthenticateUser
(String[] tenants, String username, String password) Authenticates a user.authenticateUser
(String tenant, String username, String password) Authenticates a user.authenticateUser
(org.craftercms.profile.api.Profile profile) Authenticates a user just with it's profile ID.authenticateUser
(org.craftercms.profile.api.Profile profile, boolean remembered) Authenticates a user just with it's profile ID.getAuthentication
(String ticket, boolean reloadProfile) Returns the authentication associated to the given ticket IDvoid
invalidateAuthentication
(Authentication authentication) Invalidates the given authentication.
-
Method Details
-
authenticateUser
Authentication authenticateUser(String tenant, String username, String password) throws AuthenticationException Authenticates a user.- Parameters:
tenant
- the tenant's name the user profile belongs tousername
- the user's usernamepassword
- the user's password- Returns:
- the authentication object, which contains the ticket and the user's profile
- Throws:
AuthenticationException
-
authenticateUser
Authentication authenticateUser(String[] tenants, String username, String password) throws AuthenticationException Authenticates a user.- Parameters:
tenants
- the tenant chain to try authentication withusername
- the user's usernamepassword
- the user's password- Returns:
- the authentication object, which contains the ticket and the user's profile
- Throws:
AuthenticationException
-
authenticateUser
Authentication authenticateUser(org.craftercms.profile.api.Profile profile) throws AuthenticationException Authenticates a user just with it's profile ID. Use only when the user has already being identified.- Parameters:
profile
- the user's profile- Returns:
- the authentication object, which contains the ticket and the user's profile
- Throws:
AuthenticationException
-
authenticateUser
Authentication authenticateUser(org.craftercms.profile.api.Profile profile, boolean remembered) throws AuthenticationException Authenticates a user just with it's profile ID. Use only when the user has already being identified.- Parameters:
profile
- the user's profileremembered
- if the authentication was done through remember me.- Returns:
- the authentication object, which contains the ticket and the user's profile
- Throws:
AuthenticationException
-
getAuthentication
Authentication getAuthentication(String ticket, boolean reloadProfile) throws AuthenticationException Returns the authentication associated to the given ticket ID- Parameters:
ticket
- the authentication ticketreloadProfile
- if the cached profile should be reloaded- Returns:
- the authentication object associated to the ticket ID, or null if no authentication was found for the ticket ID (anonymous user)
- Throws:
AuthenticationException
-
invalidateAuthentication
Invalidates the given authentication.- Parameters:
authentication
- the authentication to invalidate- Throws:
AuthenticationException
-