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