Class AuthClient


  • public class AuthClient
    extends java.lang.Object
    Smartcar OAuth 2.0 Authentication Client
    • Method Detail

      • authUrlBuilder

        public AuthClient.AuthUrlBuilder authUrlBuilder​(java.lang.String[] scope)
        Creates an AuthUrlBuilder
        Parameters:
        scope - the permission scope(s) requested
        Returns:
        returns an instance of AuthUrlBuilder
      • exchangeCode

        public Auth exchangeCode​(java.lang.String code)
                          throws SmartcarException
        Exchanges an authorization code for an access token.
        Parameters:
        code - the authorization code
        Returns:
        the requested access token
        Throws:
        SmartcarException - when the request is unsuccessful
      • exchangeCode

        public Auth exchangeCode​(java.lang.String code,
                                 SmartcarAuthOptions options)
                          throws SmartcarException
        Exchanges an authorization code for an access token.
        Parameters:
        code - the authorization code
        options - the SmartcarAuthOptions
        Returns:
        the requested access token
        Throws:
        SmartcarException - when the request is unsuccessful
      • exchangeRefreshToken

        public Auth exchangeRefreshToken​(java.lang.String refreshToken)
                                  throws SmartcarException
        Exchanges a refresh token for a new access token.
        Parameters:
        refreshToken - the refresh token
        Returns:
        the requested access token
        Throws:
        SmartcarException - when the request is unsuccessful
      • exchangeRefreshToken

        public Auth exchangeRefreshToken​(java.lang.String refreshToken,
                                         SmartcarAuthOptions options)
                                  throws SmartcarException
        Exchanges a refresh token for a new access token.
        Parameters:
        refreshToken - the refresh token
        options - the SmartcarAuthOptions
        Returns:
        the requested access token
        Throws:
        SmartcarException - when the request is unsuccessful
      • getClientId

        public java.lang.String getClientId()
      • getClientSecret

        public java.lang.String getClientSecret()
      • getRedirectUri

        public java.lang.String getRedirectUri()