Interface AuthenticationService


  • public interface AuthenticationService
    Service for handling authentication for users.
    Author:
    avasquez
    • 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 name
        username - the username
        password - 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