public static enum TokenValidator.Policy extends Enum<TokenValidator.Policy>
| Enum Constant and Description |
|---|
IGNORE
Specifies that attempts to perform ASAP authentication with this resource should be silently ignored.
|
OPTIONAL
Specifies that ASAP authentication is optional, but will be enforced exactly as it would for the
REQUIRE policy whenever a suitable Authorization header is present. |
REJECT
Specifies that attempts to perform ASAP authentication with this resource should be actively rejected.
|
REQUIRE
Specifies that ASAP authentication is required.
|
| Modifier and Type | Method and Description |
|---|---|
static TokenValidator.Policy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TokenValidator.Policy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TokenValidator.Policy REJECT
This policy is intended to prohibit ASAP authentication when that ability might otherwise have been inherited from some other source, such as a superclass or package annotation.
Note that since this policy refuses all ASAP tokens regardless of their contents, tokens are not passed through their normal validity checks. Any token received is assumed to pass authentication and rejected as unauthorized, instead.
public static final TokenValidator.Policy IGNORE
This annotation is intended to ignore ASAP authentication when that ability might otherwise
have been inherited from some other source, such as a superclass or package annotation.
The validator will always ABSTAIN from the decision and
will not attempt to examine the Authorization header in any way.
public static final TokenValidator.Policy OPTIONAL
REQUIRE policy whenever a suitable Authorization header is present.
This permits alternative forms of authentication and/or anonymous request processing to be used. The resource is responsible for arranging whatever additional annotations and/or access filtering might be needed.
Note that the only difference between OPTIONAL and REQUIRED is how the complete
absence of an ASAP token is handled, with this policy returning ABSTAIN
instead of NOT_AUTHENTICATED for that specific case. In particular,
a client cannot attempt ASAP authentication, fail at it, and then proceed anonymously. If an ASAP
token is provided, then it must meet all the necessary requirements, or the request will be rejected.
public static final TokenValidator.Policy REQUIRE
If no authentication token is provided or if it does not satisfy the restrictions specified by the annotation, then the request should be actively rejected.
public static TokenValidator.Policy[] values()
for (TokenValidator.Policy c : TokenValidator.Policy.values()) System.out.println(c);
public static TokenValidator.Policy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2017 Atlassian. All rights reserved.