Modifier and Type | Method and Description |
---|---|
static Bearer |
bearer(BiFunction<String,Request,Optional<Request>> authenticator)
Creates a bearer token authenticator.
|
static Bearer |
bearer(String key,
Object... roles)
Creates a key-based bearer token authenticator.
|
Handler |
wrap(Handler handler)
Wraps a handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
postprocessor, postprocessor, preprocessor, preprocessor, roles, roles, with, wrapper, wrapper
public static Bearer bearer(String key, Object... roles)
key
- the fixed key to be presented as bearer tokenroles
- a collection of values uniquely identifying the roles to be assigned to the request user on successful key
validationNullPointerException
- if roles
is null or contains a null
valueIllegalArgumentException
- if key
is emptypublic static Bearer bearer(BiFunction<String,Request,Optional<Request>> authenticator)
authenticator
- the delegated authentication service; takes as argument the bearer token presented with the
request and the request itself; returns an optional configured request on successful token
validation or an empty optional otherwiseNullPointerException
- if authenticator
is nullCopyright © 2013–2021 Metreeca. All rights reserved.