Package com.bandwidth

Class TwoFactorAuthBasicAuthManager

java.lang.Object
com.bandwidth.TwoFactorAuthBasicAuthManager
All Implemented Interfaces:
AuthManager, TwoFactorAuthBasicAuthCredentials

public class TwoFactorAuthBasicAuthManager
extends java.lang.Object
implements AuthManager, TwoFactorAuthBasicAuthCredentials
Utility class for authorization and token management.
  • Constructor Summary

    Constructors 
    Constructor Description
    TwoFactorAuthBasicAuthManager​(java.lang.String username, java.lang.String password)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    HttpRequest apply​(HttpRequest httpRequest)
    Adds authentication to the given HttpRequest.
    java.util.concurrent.CompletableFuture<HttpRequest> applyAsync​(HttpRequest httpRequest)
    Asynchronously adds authentication to the given HttpRequest.
    boolean equals​(java.lang.String basicAuthUserName, java.lang.String basicAuthPassword)
    Checks if provided credentials matched with existing ones.
    java.lang.String getBasicAuthPassword()
    String value for basicAuthPassword.
    java.lang.String getBasicAuthUserName()
    String value for basicAuthUserName.
    java.lang.String toString()
    Converts this TwoFactorAuthBasicAuthManager into string format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TwoFactorAuthBasicAuthManager

      public TwoFactorAuthBasicAuthManager​(java.lang.String username, java.lang.String password)
      Constructor.
      Parameters:
      username - String value for username.
      password - String value for password.
  • Method Details

    • getBasicAuthUserName

      public java.lang.String getBasicAuthUserName()
      String value for basicAuthUserName.
      Specified by:
      getBasicAuthUserName in interface TwoFactorAuthBasicAuthCredentials
      Returns:
      basicAuthUserName
    • getBasicAuthPassword

      public java.lang.String getBasicAuthPassword()
      String value for basicAuthPassword.
      Specified by:
      getBasicAuthPassword in interface TwoFactorAuthBasicAuthCredentials
      Returns:
      basicAuthPassword
    • equals

      public boolean equals​(java.lang.String basicAuthUserName, java.lang.String basicAuthPassword)
      Checks if provided credentials matched with existing ones.
      Specified by:
      equals in interface TwoFactorAuthBasicAuthCredentials
      Parameters:
      basicAuthUserName - String value for credentials.
      basicAuthPassword - String value for credentials.
      Returns:
      true if credentials matched.
    • toString

      public java.lang.String toString()
      Converts this TwoFactorAuthBasicAuthManager into string format.
      Overrides:
      toString in class java.lang.Object
      Returns:
      String representation of this class
    • apply

      public HttpRequest apply​(HttpRequest httpRequest)
      Adds authentication to the given HttpRequest.
      Specified by:
      apply in interface AuthManager
      Parameters:
      httpRequest - HttpRequest object for authentication
      Returns:
      Returns the object of HttpRequest
    • applyAsync

      public java.util.concurrent.CompletableFuture<HttpRequest> applyAsync​(HttpRequest httpRequest)
      Asynchronously adds authentication to the given HttpRequest.
      Specified by:
      applyAsync in interface AuthManager
      Parameters:
      httpRequest - HttpRequest object for authentication
      Returns:
      Returns the completable future of HttpRequest