Class RequestTokenGrantCallback

java.lang.Object
com.amilesend.tmdb.client.connection.auth.RequestTokenGrantCallback
All Implemented Interfaces:
HttpHandler

public class RequestTokenGrantCallback extends Object implements HttpHandler
Callback to handle approval or denial responses upon requesting a token used to create a user session.
See Also:
  • Constructor Details

    • RequestTokenGrantCallback

      public RequestTokenGrantCallback(String callbackPath, String successLandingPageUrl, String failureLandingPageUrl)
  • Method Details

    • handle

      public void handle(@NonNull HttpExchange httpExchange) throws IOException
      Specified by:
      handle in interface HttpHandler
      Throws:
      IOException
    • waitForApprovalStatus

      public boolean waitForApprovalStatus() throws SessionException
      Blocks until the server receives a request token auth grant approval, or when the lock is explicitly released (e.g., shutdown).
      Returns:
      the authorization callback url used to request a new session.
      Throws:
      SessionException - if no response was ever received from TMDB
    • releaseLock

      public void releaseLock()
      Releases the lock.
    • builder

    • getIsApproved

      public Boolean getIsApproved()
      The URL to proceed with session registration. When not null, this implies that the request token grant was approved.