public abstract class AuthHandlerImpl extends Object implements AuthHandler
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
authorities |
protected AuthProvider |
authProvider |
protected String |
realm |
| Constructor and Description |
|---|
AuthHandlerImpl(AuthProvider authProvider) |
AuthHandlerImpl(AuthProvider authProvider,
String realm) |
| 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
|
protected String |
authenticateHeader(RoutingContext context) |
void |
authorize(User user,
Handler<AsyncResult<Void>> handler)
Authorizes the given user against all added authorities.
|
void |
handle(RoutingContext ctx)
Something has happened, so handle it.
|
protected void |
processException(RoutingContext ctx,
Throwable exception)
This method is protected so custom auth handlers can override the default
error handling
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparseCredentialsprotected final String realm
protected final AuthProvider authProvider
public AuthHandlerImpl(AuthProvider authProvider)
public AuthHandlerImpl(AuthProvider authProvider, String realm)
public AuthHandler addAuthority(String authority)
AuthHandleraddAuthority in interface AuthHandlerauthority - the authoritypublic AuthHandler addAuthorities(Set<String> authorities)
AuthHandleraddAuthorities in interface AuthHandlerauthorities - the set of authoritiespublic void authorize(User user, Handler<AsyncResult<Void>> handler)
AuthHandlerauthorize in interface AuthHandleruser - a user.handler - the handler for the result.protected String authenticateHeader(RoutingContext context)
public void handle(RoutingContext ctx)
Handlerhandle in interface Handler<RoutingContext>ctx - the event to handleprotected void processException(RoutingContext ctx, Throwable exception)
Copyright © 2020. All rights reserved.