public interface BearerAuthCredentials extends BearerCredentials, AuthCredentials<BearerAuthCredentials,BearerCredentials>
AuthCredentials.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
AuthCredentials.toHttpAuthorization()
.org.refcodes.mixin.TokenAccessor.TokenBuilder<B extends org.refcodes.mixin.TokenAccessor.TokenBuilder<B>>, org.refcodes.mixin.TokenAccessor.TokenMutator, org.refcodes.mixin.TokenAccessor.TokenProperty
AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypeProperty
Modifier and Type | Field and Description |
---|---|
static char |
DELIMITER_BEARER_AUTH |
Modifier and Type | Method and Description |
---|---|
default AuthType |
getAuthType()
Retrieves the
AuthType from the Authorization-Type property (or
null if there are none such credentials). |
default void |
validate(BearerCredentials aCredentials)
Validates the provided
BearerCredentials with this
BearerAuthCredentials via BearerCredentials.isValid(BearerCredentials) . |
default void |
validate(String aToken)
Validates the provided user-name and secret with this
BearerAuthCredentials via BearerCredentials.isValid(String) . |
default BearerAuthCredentials |
withHttpAuthorization(String aHttpAuthorization)
Initializes this
AuthCredentials instance from the
HeaderField.AUTHORIZATION Header-Fields's value. |
isValid, isValid
fromHttpAuthorization, toHttpAuthorization
static final char DELIMITER_BEARER_AUTH
default void validate(BearerCredentials aCredentials) throws ForbiddenException
BearerCredentials
with this
BearerAuthCredentials
via BearerCredentials.isValid(BearerCredentials)
. In
case the provided BearerCredentials
are not valid, then a
ForbiddenException
is thrown.validate
in interface AuthCredentials<BearerAuthCredentials,BearerCredentials>
aCredentials
- The BearerCredentials
to be verified.ForbiddenException
- thrown in case the provided
BearerCredentials
do not match.default void validate(String aToken) throws ForbiddenException
BearerAuthCredentials
via BearerCredentials.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
BearerCredentials
instance.ForbiddenException
- thrown in case the provided
BearerCredentials
do not match.default BearerAuthCredentials withHttpAuthorization(String aHttpAuthorization) throws IllegalArgumentException
AuthCredentials
instance from the
HeaderField.AUTHORIZATION
Header-Fields's value.withHttpAuthorization
in interface AuthCredentials<BearerAuthCredentials,BearerCredentials>
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 © 2018. All rights reserved.