public interface AuthProvider
If you wish to use the auth service with other providers, implement this interface for your provider.
Modifier and Type | Method and Description |
---|---|
void |
hasPermission(JsonObject principal,
String permission,
Handler<AsyncResult<Boolean>> resultHandler)
Handle whether a principal has a permission
|
void |
hasRole(JsonObject principal,
String role,
Handler<AsyncResult<Boolean>> resultHandler)
Handle whether a principal has a role
|
void |
login(JsonObject principal,
JsonObject credentials,
Handler<AsyncResult<Void>> resultHandler)
Handle the actual login
|
void login(JsonObject principal, JsonObject credentials, Handler<AsyncResult<Void>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged incredentials
- the credentials - this can contain anything your provider expects, e.g. passwordresultHandler
- - this must return a failed result if login fails and it must return a succeeded result if the
login succeedsvoid hasRole(JsonObject principal, String role, Handler<AsyncResult<Boolean>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged inrole
- the roleresultHandler
- this must return a failure if the check could not be performed - e.g. the principal is not
known. Otherwise it must return a succeeded result which contains a boolean `true` if the
principal has the role, or `false` if they do not have the role.void hasPermission(JsonObject principal, String permission, Handler<AsyncResult<Boolean>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged inpermission
- the permissionresultHandler
- this must return a failure if the check could not be performed - e.g. the principal is not
known. Otherwise it must return a succeeded result which contains a boolean `true` if the
principal has the permission, or `false` if they do not have the permission.Copyright © 2015. All Rights Reserved.