Interface AuthenticationService
-
public interface AuthenticationService
Service for handling authentication for users.- Author:
- avasquez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Ticket
authenticate(String tenantName, String username, String password)
Authenticates the user, and returns a ticket identifying the authentication.PersistentLogin
createPersistentLogin(String profileId)
Creates a persistent login, use for remember me functionality.Ticket
createTicket(String profileId)
Create a new ticket for the specified profile.void
deletePersistentLogin(String loginId)
Deletes the persistent login.PersistentLogin
getPersistentLogin(String loginId)
Returns the persistent login object for the given ID.Ticket
getTicket(String ticketId)
Returns the ticket object for the given ticket ID.void
invalidateTicket(String ticketId)
Invalidates the ticket.PersistentLogin
refreshPersistentLoginToken(String loginId)
Refreshes the token of the specified persistent login.
-
-
-
Method Detail
-
authenticate
Ticket authenticate(String tenantName, String username, String password) throws ProfileException
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
Ticket createTicket(String profileId) throws ProfileException
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
Ticket getTicket(String ticketId) throws ProfileException
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
void invalidateTicket(String ticketId) throws ProfileException
Invalidates the ticket.- Parameters:
ticketId
- the ID of the ticket to invalidate- Throws:
ProfileException
-
createPersistentLogin
PersistentLogin createPersistentLogin(String profileId) throws ProfileException
Creates a persistent login, use for remember me functionality.- Parameters:
profileId
- the ID of the profile- Returns:
- the persistent login
- Throws:
ProfileException
-
getPersistentLogin
PersistentLogin getPersistentLogin(String loginId) throws ProfileException
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
PersistentLogin refreshPersistentLoginToken(String loginId) throws ProfileException
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
void deletePersistentLogin(String loginId) throws ProfileException
Deletes the persistent login.- Parameters:
loginId
- the ID of the login to invalidate- Throws:
ProfileException
-
-