public class Authorization extends Object
Represents an HTTP Authorization header value and encapsulates authorization data
| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_NAME |
| Constructor and Description |
|---|
Authorization(String authHeader) |
| Modifier and Type | Method and Description |
|---|---|
static List<Authorization> |
get(Request req) |
String |
getData() |
String |
getDataBase64Decoded() |
String |
getType() |
static boolean |
validate(Request req,
Predicate<Authorization>... validators)
Validates the given request authentication using each of the given predicates.
|
static Predicate<Authorization> |
validator(String type,
String data) |
public static final String HEADER_NAME
public Authorization(String authHeader)
public static List<Authorization> get(Request req)
req - Request instance@SafeVarargs public static boolean validate(Request req, Predicate<Authorization>... validators)
true, the request is counted as
validly authorized and the method returns true.req - Request instancevalidators - Validatorspublic static Predicate<Authorization> validator(String type, String data)
type - The expected type of the authorizationdata - The expected data of the authorizationvalidate(Request, Predicate...)
to test for a single type of authorizationpublic String getType()
public String getData()
public String getDataBase64Decoded()
Copyright © 2019. All rights reserved.