Interface AuthenticationService
- All Known Implementing Classes:
AuthenticationServiceImpl,AuthenticationServiceRestClient
public interface AuthenticationService
Service for handling authentication for users.
- Author:
- avasquez
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String tenantName, String username, String password) Authenticates the user, and returns a ticket identifying the authentication.createPersistentLogin(String profileId) Creates a persistent login, use for remember me functionality.createTicket(String profileId) Create a new ticket for the specified profile.voiddeletePersistentLogin(String loginId) Deletes the persistent login.getPersistentLogin(String loginId) Returns the persistent login object for the given ID.Returns the ticket object for the given ticket ID.voidinvalidateTicket(String ticketId) Invalidates the ticket.refreshPersistentLoginToken(String loginId) Refreshes the token of the specified persistent login.
-
Method Details
-
authenticate
Authenticates the user, and returns a ticket identifying the authentication.- Parameters:
tenantName- the tenant's nameusername- the usernamepassword- the password- Returns:
- the ticket
- Throws:
ProfileException
-
createTicket
Create a new ticket for the specified profile.Note: this method should only be used when authentication is done through other means (like when authenticating through Facebook or Twitter) different than profile, or when authenticating through a persistent login
- Parameters:
profileId- the ID of the profile- Returns:
- the ticket
- Throws:
ProfileException
-
getTicket
Returns the ticket object for the given ticket ID.- Parameters:
ticketId- the ID of the ticket- Returns:
- the ticket object, or null if no ticket found or ticket has expired
- Throws:
ProfileException
-
invalidateTicket
Invalidates the ticket.- Parameters:
ticketId- the ID of the ticket to invalidate- Throws:
ProfileException
-
createPersistentLogin
Creates a persistent login, use for remember me functionality.- Parameters:
profileId- the ID of the profile- Returns:
- the persistent login
- Throws:
ProfileException
-
getPersistentLogin
Returns the persistent login object for the given ID.- Parameters:
loginId- the ID of the login- Returns:
- the persistent login, or null if not found
- Throws:
ProfileException
-
refreshPersistentLoginToken
Refreshes the token of the specified persistent login.- Parameters:
loginId- the ID of the persistent login- Returns:
- the persistent login with the refreshed token
- Throws:
ProfileException
-
deletePersistentLogin
Deletes the persistent login.- Parameters:
loginId- the ID of the login to invalidate- Throws:
ProfileException
-