Class Authentication


  • public class Authentication
    extends Object
    Definition of authentication given to username after verification of credentials by authentication provider. Each authentication must at least point to some identity (username) and roles.
    Author:
    Ɓukasz Dywicki - Initial contribution, Kai Kreuzer - Added JavaDoc and switched from array to Set
    • Constructor Detail

      • Authentication

        protected Authentication()
        no-args constructor required by gson
      • Authentication

        public Authentication​(String username,
                              String... roles)
        Creates a new instance
        Parameters:
        username - name of the user associated to this authentication instance
        roles - a variable list of roles that the user possesses.
    • Method Detail

      • getUsername

        public String getUsername()
        Retrieves the name of the authenticated user
        Returns:
        user name
      • getRoles

        public Set<String> getRoles()
        Retrieves the roles of the authenticated user
        Returns:
        a set of roles