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()
Gets the auth type.
|
static BearerAuthCredentials |
toBearerAuthCredentials()
Factory method to create an
BearerAuthCredentials instance to be
tailored with the according properties. |
static BearerAuthCredentials |
toBearerAuthCredentials(String aToken)
Factory method to create an
BearerAuthCredentials instance from
the provided user-name and password. |
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)
With http authorization.
|
isValid, isValid
fromHttpAuthorization, toHttpAuthorization
static final char DELIMITER_BEARER_AUTH
static BearerAuthCredentials toBearerAuthCredentials()
BearerAuthCredentials
instance to be
tailored with the according properties.BearerAuthCredentials
type.static BearerAuthCredentials toBearerAuthCredentials(String aToken)
BearerAuthCredentials
instance from
the provided user-name and password.aToken
- The secret to use when constructing the instance.BearerAuthCredentials
type with the
provided user-name and secret.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
withHttpAuthorization
in interface AuthCredentials<BearerAuthCredentials,BearerCredentials>
aHttpAuthorization
- the a http authorizationIllegalArgumentException
- the illegal argument exceptiondefault AuthType getAuthType()
getAuthType
in interface AuthTypeAccessor
Copyright © 2017. All rights reserved.