public interface AuthHandler extends Handler<RoutingContext>
An auth handler allows your application to provide authentication/authorization support.
Auth handler requires a SessionHandler
to be on the routing chain before it.
Modifier and Type | Method and Description |
---|---|
AuthHandler |
addAuthorities(Set<String> authorities)
Add a set of required authorities for this auth handler
|
AuthHandler |
addAuthority(String authority)
Add a required authority for this auth handler
|
void |
authorize(User user,
Handler<AsyncResult<Void>> handler)
Authorizes the given user against all added authorities.
|
void |
parseCredentials(RoutingContext context,
Handler<AsyncResult<JsonObject>> handler)
Parses the credentials from the request into a JsonObject.
|
AuthHandler addAuthority(String authority)
authority
- the authorityAuthHandler addAuthorities(Set<String> authorities)
authorities
- the set of authoritiesvoid parseCredentials(RoutingContext context, Handler<AsyncResult<JsonObject>> handler)
context
- the routing contexthandler
- the handler to be called once the information is available.void authorize(User user, Handler<AsyncResult<Void>> handler)
user
- a user.handler
- the handler for the result.Copyright © 2023 Eclipse. All rights reserved.