Class PersonalAccountAuthManager

java.lang.Object
com.amilesend.onedrive.connection.auth.PersonalAccountAuthManager
All Implemented Interfaces:
com.amilesend.client.connection.auth.AuthManager<OneDriveAuthInfo>, OneDriveAuthManager

public class PersonalAccountAuthManager extends Object implements OneDriveAuthManager
Manager that is responsible for obtaining and refreshing tokens to interact with a personal 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.

Example initializing with an auth code:

PersonalAccountAuthManager.builderWithAuthCode()
        .httpClient(client) // the OKHttpClient instance
        .gsonFactory(gsonFactory) // preconfigured Gson instances
        .clientId(clientId) // the client ID of your application
        .clientSecret(clientSecret) // the client secret of your application
        .redirectUrl(redirectUrl) // the redirect URL for OAUTH flow
        .authCode(authCode) // The obtained auth code from initial OAUTH handshake
        .buildWithAuthCode();

Example initializing with an AuthInfo (pre-existing refresh token):

PersonalAccountAuthManager.builderWithAuthInfo()
        .httpClient(client)
        .gsonFactory(gsonFactory)
        .clientId(clientId)
        .clientSecret(clientSecret)
        .redirectUrl(redirectUrl)
        .authInfo(authInfo) // Instead of an auth code, an AuthInfo object is used to obtain the refresh token
        .buildWithAuthInfo();
See Also: