Package com.smartcar.sdk
Class AuthClient
- java.lang.Object
-
- com.smartcar.sdk.AuthClient
-
public class AuthClient extends java.lang.ObjectSmartcar OAuth 2.0 Authentication Client
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAuthClient.AuthUrlBuilderA builder for creating Authorization URLs.static classAuthClient.BuilderBuilds a new AuthClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthClient.AuthUrlBuilderauthUrlBuilder(java.lang.String[] scope)Creates an AuthUrlBuilderAuthexchangeCode(java.lang.String code)Exchanges an authorization code for an access token.AuthexchangeCode(java.lang.String code, SmartcarAuthOptions options)Exchanges an authorization code for an access token.AuthexchangeRefreshToken(java.lang.String refreshToken)Exchanges a refresh token for a new access token.AuthexchangeRefreshToken(java.lang.String refreshToken, SmartcarAuthOptions options)Exchanges a refresh token for a new access token.java.lang.StringgetClientId()java.lang.StringgetClientSecret()java.lang.StringgetRedirectUri()
-
-
-
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 codeoptions- 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 tokenoptions- 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()
-
-