Skip to content
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

Source Mailchimp: support oauth #6273

Closed
1 task done
Tracked by #7000 ...
sherifnada opened this issue Sep 19, 2021 · 3 comments · Fixed by #7159
Closed
1 task done
Tracked by #7000 ...

Source Mailchimp: support oauth #6273

sherifnada opened this issue Sep 19, 2021 · 3 comments · Fixed by #7159

Comments

@sherifnada
Copy link
Contributor

sherifnada commented Sep 19, 2021

Tell us about the problem you're trying to solve

With the release of Airbyte Cloud, we need to start supporting Oauth for this connector, since it's the recommended way of authenticating users into a SaaS application.

If this connector doesn't support oauth already (i.e: doesn't accept a client_id and client_secret) then we need to update its spec to accept those parameters. There are two ways to do this:

If the connector already supports some auth mechanism like api_key, I suggest that this be a oneof nested inside a top-level field called "authentication":

{ authentication: { type: object oneOf: [ // api key, // oauth ] } }

If the connector only supports webflow oauth, then no changes are needed to the properties format and we will only need to add annotations.

See the connector spec reference in the docs for reference on how a oneof can be implemented.

This should be done in a backwards compatible manner i.e: users currently supplying authentication info in the config's top-level should not be impacted by this change.

Acceptance Criteria

  1. The connector supports oauth webflow authentication with client_id/client_secret in a backwards compatible manner
  2. Oauth properties are annotated properly. See this PR for an example
@sherifnada sherifnada added area/oauth area/connectors Connector related issues labels Sep 19, 2021
@igrankova igrankova self-assigned this Oct 4, 2021
@igrankova
Copy link
Contributor

igrankova commented Oct 4, 2021

@annalvova05 annalvova05 self-assigned this Oct 6, 2021
@annalvova05 annalvova05 linked a pull request Oct 19, 2021 that will close this issue
15 tasks
@antixar
Copy link
Contributor

antixar commented Nov 4, 2021

Source Mailchimp: add oauth flow (java part)

https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/

=========== JAVA PART ================

Approve access from the customer side using:
client_id

https://login.mailchimp.com/oauth2/authorize?response_type=code&client_id=1234567890&redirect_uri=https://airbyte.io/

Get redirect url with 'code':

https://airbyte.io/?code=33333333

Obtain token using

curl https://login.mailchimp.com/oauth2/token
-X POST
-H 'Content-Type: application/json'
-d '{
"client_id": "1234567890",
"client_secret": "2222222",
"grant_type": "authorization_code",
"code": "3333333",
"redirect_uri": "https://airbyte.io/"
}'

RESPONSE:
{
"access_token": "1q2w3e4r5t6y.",
"expires_in": "0",
"scope": null
}

OAuth access tokens do not expire.

Obtain server_prefix (dc) using

curl https://login.mailchimp.com/oauth2/metadata
-X GET
-H 'Authorization: Bearer <access_token>'

RESPONSE:
{
"dc": "us2",
"role": "admin",
"accountname": "Airbyte",
"user_id": 123,
"login": {
"email": "email@email.com",
"avatar": null,
"login_id": 12345,
"login_name": "email@email.com",
"login_email": "email@email.com"
},
"login_url": "https://login.mailchimp.com",
"api_endpoint": "https://us2.api.mailchimp.com"
}

============== PYTHON PART =====================

API requests using access_token and server_prefix (dc).

$ curl
-s https://{server_prefix}.api.mailchimp.com/3.0/campaigns
-H 'Authorization: Bearer <access_token>'

@annalvova05
Copy link
Contributor

Can not test OAuth flow locally, due to impossible set localhost as redirect URL in Mailchimp. Move to ON Hold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants