java.lang.Object
org.miaixz.bus.http.secure.NetAuthenticator
- All Implemented Interfaces:
Authenticator
An authenticator that bridges Httpd's authentication mechanism with Java's built-in
Authenticator.
This allows the client to use credentials configured globally in the JVM.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from interface org.miaixz.bus.http.secure.Authenticator
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Route route, Response response) Returns a request that includes a credential to satisfy an authentication challenge inresponse.
-
Constructor Details
-
NetAuthenticator
public NetAuthenticator()
-
-
Method Details
-
authenticate
Description copied from interface:AuthenticatorReturns a request that includes a credential to satisfy an authentication challenge inresponse. Returnsnullif the challenge cannot be satisfied.The
routeparameter is a best-effort and may not always be provided, especially when an authenticator is invoked manually in an application interceptor (e.g., for client-specific retries).- Specified by:
authenticatein interfaceAuthenticator- Parameters:
route- The route that resulted in the challenge, or null if not available.response- The response containing the authentication challenge.- Returns:
- A new request with the appropriate authentication header, or null if no response is possible.
- Throws:
IOException- if an I/O error occurs.
-