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