AuthTypeAccessor
, AuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
, org.refcodes.mixin.TokenAccessor
, TokenCredentials
, org.refcodes.mixin.Validatable<TokenCredentials>
BeararAuthCredentialsImpl
public interface BearerAuthCredentials extends TokenCredentials, AuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
AuthTypeCredentials.fromHttpAuthorization(String)
and feed it with the header's
HeaderField.AUTHORIZATION
field's value. To create the according
Header-Field's value from the BearerAuthCredentials
type, call
AuthTypeCredentials.toHttpAuthorization()
.AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypeProperty
Modifier and Type | Field | Description |
---|---|---|
static char |
DELIMITER_AUTH_TYPE |
Modifier and Type | Method | Description |
---|---|---|
default AuthType |
getAuthType() |
Retrieves the
AuthType from the Authorization-Type property (or
null if there are none such credentials). |
default void |
validate(String aToken) |
Validates the provided user-name and secret with this
BearerAuthCredentials via TokenCredentials.isValid(String) . |
default void |
validate(TokenCredentials aCredentials) |
Validates the provided
TokenCredentials with this
BearerAuthCredentials via TokenCredentials.isValid(TokenCredentials) . |
default BearerAuthCredentials |
withHttpAuthorization(String aHttpAuthorization) |
Initializes this
AuthTypeCredentials instance from the
HeaderField.AUTHORIZATION Header-Fields's value. |
fromHttpAuthorization, toHttpAuthorization
isValid, isValid
static final char DELIMITER_AUTH_TYPE
default void validate(TokenCredentials aCredentials) throws ForbiddenException
TokenCredentials
with this
BearerAuthCredentials
via TokenCredentials.isValid(TokenCredentials)
. In
case the provided TokenCredentials
are not valid, then a
ForbiddenException
is thrown.validate
in interface AuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
aCredentials
- The TokenCredentials
to be verified.ForbiddenException
- thrown in case the provided
TokenCredentials
do not match.default void validate(String aToken) throws ForbiddenException
BearerAuthCredentials
via TokenCredentials.isValid(String)
. In case the
provided credentials are not valid, then a ForbiddenException
is
thrown.aToken
- The secret part to be tested if it fits with the this
TokenCredentials
instance.ForbiddenException
- thrown in case the provided
TokenCredentials
do not match.default BearerAuthCredentials withHttpAuthorization(String aHttpAuthorization) throws IllegalArgumentException
AuthTypeCredentials
instance from the
HeaderField.AUTHORIZATION
Header-Fields's value.withHttpAuthorization
in interface AuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
aHttpAuthorization
- The HeaderField.AUTHORIZATION
header
field's valueIllegalArgumentException
- The value does not conform the the HTTP
Authorization Header-Field's Basic-Authentication format.default AuthType getAuthType()
AuthType
from the Authorization-Type property (or
null if there are none such credentials).getAuthType
in interface AuthTypeAccessor
AuthType
stored by the Basic-Authentication
credentials property (or null if there are none such
credentials).Copyright © 2021. All rights reserved.