Class 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 Detail

      • OAuth2Authenticator

        public OAuth2Authenticator()
    • Method Detail

      • refreshToken

        public OAuth2Tokens refreshToken​(OAuth2Tokens at,
                                         String clientId,
                                         String clientSecret)
        Parameters:
        clientSecret -
        clientId -
        at - immutable instance of OAuth2Tokens
        Returns: