-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend low code OAuthAuthenticator with token refresh capabilities #26966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 🚢
self.access_token = new_access_token | ||
self.set_refresh_token(new_refresh_token) | ||
self.set_token_expiry_date(new_token_expiry_date) | ||
emit_configuration_as_airbyte_control_message(self._connector_config) | ||
return self.access_token | ||
|
||
def refresh_access_token(self) -> Tuple[str, int, str]: | ||
def refresh_access_token(self) -> Tuple[str, str, str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine because the cast is done in get_new_token_expiry_date
@girarda Could you take another quick look? Adjusted as discussed in grooming: Make work with empty config values (remove validation and do not fail on empty config values) The discussed removal of the direct SingleUseRefreshTokenOAuthAuthenticator in low code will be done in a follow-up PR: #27053 Tested two affected connectors below to make sure things still work |
/test connector=connectors/source-quickbooks local_cdk=1
Build PassedTest summary info:
|
/test connector=connectors/source-gitlab local_cdk=1
Build PassedTest summary info:
|
What
Related to #26342
Allow a user to specify a refresh token updater object as part of the
OAuthAuthenticator
low code component:If specified, the refresh token, access token and access token expiry time returned from the authentication response is written back to the config object. This is important if a refresh token can only be used once.
How
Following changes were necessary in the CDK class:
On the low code CDK side, the jinja interpolation happens in the factory at creation time.
Changes to quickbooks and removing the existing low code component will happen on a separate PR.
Long term, it's planned to merge the functionality in a single class, this has been split out of the initial phase to reduce risk and scope.
🚨 User Impact 🚨
SingleUseRefreshTokenOAuth2Authenticator interface does not support custom config paths anymore for client id and client secret, needs to be adapted by resolving them before creating an instance.