Package com.bandwidth
Class MultiFactorAuthBasicAuthManager
- java.lang.Object
-
- com.bandwidth.MultiFactorAuthBasicAuthManager
-
- All Implemented Interfaces:
AuthManager
,MultiFactorAuthBasicAuthCredentials
public class MultiFactorAuthBasicAuthManager extends Object implements AuthManager, MultiFactorAuthBasicAuthCredentials
Utility class for authorization and token management.
-
-
Constructor Summary
Constructors Constructor Description MultiFactorAuthBasicAuthManager(String username, String password)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequest
apply(HttpRequest httpRequest)
Adds authentication to the given HttpRequest.CompletableFuture<HttpRequest>
applyAsync(HttpRequest httpRequest)
Asynchronously adds authentication to the given HttpRequest.boolean
equals(String basicAuthUserName, String basicAuthPassword)
Checks if provided credentials matched with existing ones.String
getBasicAuthPassword()
String value for basicAuthPassword.String
getBasicAuthUserName()
String value for basicAuthUserName.String
toString()
Converts this MultiFactorAuthBasicAuthManager into string format.
-
-
-
Method Detail
-
getBasicAuthUserName
public String getBasicAuthUserName()
String value for basicAuthUserName.- Specified by:
getBasicAuthUserName
in interfaceMultiFactorAuthBasicAuthCredentials
- Returns:
- basicAuthUserName
-
getBasicAuthPassword
public String getBasicAuthPassword()
String value for basicAuthPassword.- Specified by:
getBasicAuthPassword
in interfaceMultiFactorAuthBasicAuthCredentials
- Returns:
- basicAuthPassword
-
equals
public boolean equals(String basicAuthUserName, String basicAuthPassword)
Checks if provided credentials matched with existing ones.- Specified by:
equals
in interfaceMultiFactorAuthBasicAuthCredentials
- Parameters:
basicAuthUserName
- String value for credentials.basicAuthPassword
- String value for credentials.- Returns:
- true if credentials matched.
-
toString
public String toString()
Converts this MultiFactorAuthBasicAuthManager into string format.
-
apply
public HttpRequest apply(HttpRequest httpRequest)
Adds authentication to the given HttpRequest.- Specified by:
apply
in interfaceAuthManager
- Parameters:
httpRequest
- HttpRequest object for authentication- Returns:
- Returns the object of HttpRequest
-
applyAsync
public CompletableFuture<HttpRequest> applyAsync(HttpRequest httpRequest)
Asynchronously adds authentication to the given HttpRequest.- Specified by:
applyAsync
in interfaceAuthManager
- Parameters:
httpRequest
- HttpRequest object for authentication- Returns:
- Returns the completable future of HttpRequest
-
-