Package org.openhab.core.auth
Class Authentication
java.lang.Object
org.openhab.core.auth.Authentication
Definition of authentication given to username after verification of credentials by authentication provider.
Each authentication must at least point to some identity (username), roles, and may also be valid for a specific
scope only.
- Author:
- Ćukasz Dywicki - Initial contribution, Kai Kreuzer - Added JavaDoc and switched from array to Set, Yannick Schaus - Add scope
-
Constructor Summary
ModifierConstructorDescriptionprotected
no-args constructor required by gsonAuthentication
(String username, String... roles) Creates a new instanceAuthentication
(String username, String[] roles, String scope) Creates a new instance with a specific scope -
Method Summary
-
Constructor Details
-
Authentication
protected Authentication()no-args constructor required by gson -
Authentication
Creates a new instance- Parameters:
username
- name of the user associated to this authentication instanceroles
- a variable list of roles that the user possesses.
-
Authentication
Creates a new instance with a specific scope- Parameters:
username
- name of the user associated to this authentication instanceroles
- a variable list of roles that the user possesses.scope
- a scope this authentication is valid for
-
-
Method Details
-
getUsername
Retrieves the name of the authenticated user- Returns:
- user name
-
getRoles
Retrieves the roles of the authenticated user- Returns:
- a set of roles
-
getScope
Retrieves the scope this authentication is valid for- Returns:
- a scope
-