Package org.teiid.google.auth
Class OAuth2Authenticator
- java.lang.Object
-
- org.teiid.google.auth.OAuth2Authenticator
-
public class OAuth2Authenticator extends Object
This authenticator is used to work with OAuth2 for devices[1]. This class can be used for two purposes: - Allowing user to give permission to Teiid Connector thus creating a refresh and access tokens - Allowing refreshing the access token using the refresh token. The authResponse contains link which user has to type into the browser. Then he has to enter userCode. After he has done that we can use the deviceCode to retrieve access and refresh tokens:System.out.println(oauth.getAccessGoogleTokens(authResponse.getDeviceCode()));
[1] https://developers.google.com/accounts/docs/OAuth2ForDevices- Author:
- fnguyen
-
-
Constructor Summary
Constructors Constructor Description OAuth2Authenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2Tokens
refreshToken(OAuth2Tokens at, String clientId, String clientSecret)
-
-
-
Method Detail
-
refreshToken
public OAuth2Tokens refreshToken(OAuth2Tokens at, String clientId, String clientSecret)
- Parameters:
clientSecret
-clientId
-at
- immutable instance of OAuth2Tokens- Returns:
-
-