new AuthService()
Vert.x authentication and authorisation service.
Handles authentication and role/permission based authorisation.
- Source:
Methods
-
hasPermission(loginID, permission, resultHandler) → {AuthService}
-
Does the user have the specified permission?
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. permissionstring the permission resultHandlerfunction will be called with the result - true if has permission, false if not - Source:
Returns:
- Type
- AuthService
-
hasPermissions(loginID, permissions, resultHandler) → {AuthService}
-
Does the user have the specified permissions?
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. permissionsArray.<string> the set of permissions resultHandlerfunction will be called with the result - true if has permissions, false if not - Source:
Returns:
- Type
- AuthService
-
hasRole(loginID, role, resultHandler) → {AuthService}
-
Does the user have the specified role?
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. rolestring the role resultHandlerfunction will be called with the result - true if has role, false if not - Source:
Returns:
- Type
- AuthService
-
hasRoles(loginID, roles, resultHandler) → {AuthService}
-
Does the user have the specified roles?
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. rolesArray.<string> the set of roles resultHandlerfunction will be called with the result - true if has roles, false if not - Source:
Returns:
- Type
- AuthService
-
login(principal, credentials, resultHandler) → {AuthService}
-
Authenticate (login) using the specified credentials. The contents of the credentials depend on what the auth provider is expecting. The default login ID timeout will be used.
Parameters:
Name Type Description principalObject represents the unique id (e.g. username) of the user being logged in credentialsObject the credentials - e.g. password resultHandlerfunction will be passed a failed result if login failed or will be passed a succeeded result containing the login ID (a string) if login was successful. - Source:
Returns:
- Type
- AuthService
-
loginWithTimeout(principal, credentials, timeout, resultHandler) → {AuthService}
-
Authenticate (login) using the specified credentials. The contents of the credentials depend on what the auth provider is expecting. The specified login ID timeout will be used.
Parameters:
Name Type Description principalObject represents the unique id (e.g. username) of the user being logged in credentialsObject the credentials timeoutnumber the login timeout to use, in ms resultHandlerfunction will be passed a failed result if login failed or will be passed a succeeded result containing the login ID (a string) if login was successful. - Source:
Returns:
- Type
- AuthService
-
logout(loginID, resultHandler) → {AuthService}
-
Logout the user
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. resultHandlerfunction will be called with success or failure - Source:
Returns:
- Type
- AuthService
-
refreshLoginSession(loginID, resultHandler) → {AuthService}
-
Refresh an existing login ID so it doesn't expire
Parameters:
Name Type Description loginIDstring the login ID as provided by #login. resultHandlerfunction will be called with success or failure - Source:
Returns:
- Type
- AuthService
-
setReaperPeriod(reaperPeriod) → {AuthService}
-
Set the reaper period - how often to check for expired logins, in ms.
Parameters:
Name Type Description reaperPeriodnumber the reaper period, in ms - Source:
Returns:
- Type
- AuthService
-
start()
-
Start the service
- Source:
-
stop()
-
Stop the service
- Source: