Package org.glassfish.tyrus.client.auth
Class AuthConfig.Builder
java.lang.Object
org.glassfish.tyrus.client.auth.AuthConfig.Builder
- Enclosing class:
AuthConfig
The AuthConfig.Builder is a class used for creating an instance of
AuthConfig
for purpose of HTTP
Authentication.
Example 1 - building an authentication configuration enhanced with user defined NTLM authentication and overridden Basic Authentication:
AuthConfig authConfig = AuthConfig.Builder.create().
registerAuthProvider("NTLM", myAuthenticator).
registerAuthProvider("Basic", myBasicAuthenticator).
build();
Example 2 - Building an authentication configuration with disabled Basic scheme authenticator:
AuthConfig authConfig = AuthConfig.Builder.create().
disableProvidedBasicAuth().
build();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build an instance ofAuthConfig
.static AuthConfig.Builder
create()
Create newAuthConfig.Builder
instance, which contains provided Basic and Digest authenticators.final AuthConfig.Builder
Disable provided BasicAuthenticator
.final AuthConfig.Builder
Disable provided DigestAuthenticator
.final AuthConfig.Builder
registerAuthProvider
(String scheme, Authenticator authenticator) RegisterAuthenticator
for provided authentication scheme.
-
Method Details
-
create
Create newAuthConfig.Builder
instance, which contains provided Basic and Digest authenticators.- Returns:
AuthConfig.Builder
instance.
-
registerAuthProvider
RegisterAuthenticator
for provided authentication scheme.Only one
Authenticator
for one authentication scheme can be registered. If current builder instance already containsAuthenticator
for provided scheme, existing authenticator will be replaced. Note that schemes are compared in case insensitive manner.- Parameters:
scheme
- authentication scheme for which the registered authenticator will be used. Scheme is compared case insensitive.authenticator
-Authenticator
instance to be registered.- Returns:
- updated
AuthConfig.Builder
instance.
-
disableProvidedBasicAuth
Disable provided BasicAuthenticator
.- Returns:
- updated
AuthConfig.Builder
instance.
-
disableProvidedDigestAuth
Disable provided DigestAuthenticator
.- Returns:
- updated
AuthConfig.Builder
instance.
-
build
Build an instance ofAuthConfig
.- Returns:
- an instance of
AuthConfig
.
-