Interface OneDriveAuthManager

All Superinterfaces:
com.amilesend.client.connection.auth.AuthManager<OneDriveAuthInfo>
All Known Implementing Classes:
BusinessAccountAuthManager, PersonalAccountAuthManager

public interface OneDriveAuthManager extends com.amilesend.client.connection.auth.AuthManager<OneDriveAuthInfo>
The interface that defines the manager that is responsible for obtaining and refreshing tokens to interact with a OneDrive account. Note: This does not manage the initial stages of the OAUTH request flow and instead relies on a provided auth code or a pre-existing refresh token.
  • Field Details

  • Method Details

    • addAuthentication

      default okhttp3.Request.Builder addAuthentication(okhttp3.Request.Builder requestBuilder)
      Specified by:
      addAuthentication in interface com.amilesend.client.connection.auth.AuthManager<OneDriveAuthInfo>
    • isExpired

      boolean isExpired()
      Determines if the current authentication information is expired.
      Returns:
      true if expired; else, false
    • refreshIfExpired

      default void refreshIfExpired()
      Checks to see if the current authentication info is expired and refreshes the tokens accordingly.
    • refreshIfExpiredAndFetchFullToken

      default String refreshIfExpiredAndFetchFullToken()
      Helper method to refresh authentication if expired and return the full token used in request headers.
      Returns:
      the full auth token
    • getAuthenticatedEndpoint

      String getAuthenticatedEndpoint()
      Retrieves the associated endpoint to use for OneDrive operations.
    • redeemToken

      OneDriveAuthInfo redeemToken(String authCode)
      Issues a request to redeem the given authCode in order to retrieve access and refresh tokens as a OneDriveAuthInfo.
      Parameters:
      authCode - the authorization code
      Returns:
      the authorization information
      See Also:
    • refreshToken

      OneDriveAuthInfo refreshToken()
      Issues a request to refresh the auth tokens and returns the refreshed tokens as a OneDriveAuthInfo.
      Returns:
      the authorization information
      See Also:
    • fetchAuthInfo

      static OneDriveAuthInfo fetchAuthInfo(okhttp3.OkHttpClient httpClient, okhttp3.Request request)
      Helper method to dispatch the request to redeem or refresh authorization tokens.
      Parameters:
      httpClient - the http client
      request - the request
      Returns:
      the authorization information