public interface BasicAuthCredentials extends BasicCredentials, AuthCredentials<BasicAuthCredentials,BasicCredentials>
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 BasicAuthCredentials
type, call
AuthCredentials.toHttpAuthorization()
.org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B extends org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B>>, org.refcodes.mixin.CredentialsAccessor.CredentialsMutator, org.refcodes.mixin.CredentialsAccessor.CredentialsProperty
org.refcodes.mixin.UserNameAccessor.UserNameBuilder<B extends org.refcodes.mixin.UserNameAccessor.UserNameBuilder<B>>, org.refcodes.mixin.UserNameAccessor.UserNameMutator, org.refcodes.mixin.UserNameAccessor.UserNameProperty
org.refcodes.mixin.SecretAccessor.SecretBuilder<B extends org.refcodes.mixin.SecretAccessor.SecretBuilder<B>>, org.refcodes.mixin.SecretAccessor.SecretMutator, org.refcodes.mixin.SecretAccessor.SecretProperty
AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypeProperty
Modifier and Type | Field and Description |
---|---|
static char |
DELIMITER_BASIC_AUTH |
static char |
DELIMITER_CREDENTIALS |
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(BasicCredentials aCredentials)
Validates the provided
BasicCredentials with this
BasicAuthCredentials via BasicCredentials.isValid(BasicCredentials) . |
default void |
validate(String aUserName,
String aSecret)
Validates the provided user-name and secret with this
BasicAuthCredentials via BasicCredentials.isValid(String, String) . |
default BasicAuthCredentials |
withHttpAuthorization(String aHttpAuthorization)
Initializes this
AuthCredentials instance from the
HeaderField.AUTHORIZATION Header-Fields's value. |
isValid, isValid
fromHttpAuthorization, toHttpAuthorization
static final char DELIMITER_BASIC_AUTH
static final char DELIMITER_CREDENTIALS
default void validate(BasicCredentials aCredentials) throws ForbiddenException
BasicCredentials
with this
BasicAuthCredentials
via BasicCredentials.isValid(BasicCredentials)
. In
case the provided BasicCredentials
are not valid, then a
ForbiddenException
is thrown.validate
in interface AuthCredentials<BasicAuthCredentials,BasicCredentials>
aCredentials
- The BasicCredentials
to be verified.ForbiddenException
- thrown in case the provided
BasicCredentials
do not match.default void validate(String aUserName, String aSecret) throws ForbiddenException
BasicAuthCredentials
via BasicCredentials.isValid(String, String)
. In
case the provided credentials are not valid, then a
ForbiddenException
is thrown.aUserName
- The user-name part to be tested if it fits with the this
BasicCredentials
instance.aSecret
- The secret part to be tested if it fits with the this
BasicCredentials
instance.ForbiddenException
- thrown in case the provided
BasicCredentials
do not match.default BasicAuthCredentials withHttpAuthorization(String aHttpAuthorization) throws IllegalArgumentException
AuthCredentials
instance from the
HeaderField.AUTHORIZATION
Header-Fields's value.withHttpAuthorization
in interface AuthCredentials<BasicAuthCredentials,BasicCredentials>
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 © 2017. All rights reserved.