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 Slack: support Oauth #6256

Closed
sherifnada opened this issue Sep 19, 2021 · 1 comment · Fixed by #6570
Closed

Source Slack: support Oauth #6256

sherifnada opened this issue Sep 19, 2021 · 1 comment · Fixed by #6570

Comments

@sherifnada
Copy link
Contributor

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. I suggest that this be a oneof nested inside a top-level field called "authentication":

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

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
  2. Oauth properties are annotated properly. See this PR for an example
@sherifnada sherifnada added type/enhancement New feature or request area/connectors Connector related issues area/oauth labels Sep 19, 2021
@htrueman htrueman self-assigned this Sep 20, 2021
@htrueman
Copy link
Contributor

htrueman commented Sep 20, 2021

Scoping Report

Scoping Report

There are 3 step described by the Slack docs following the usage of oauth:

  1. Sending users to authorize and/or install. The following values should be passed as GET parameters:
  • client_id - issued when you created your app (required)
  • scope - permissions to request (see below) (required)
  • redirect_uri - URL to redirect back to (see below) (optional)
  • state - unique string to be passed back upon completion (optional)
  • team - Slack team ID of a workspace to attempt to restrict to (optional)
  1. Redirect to your server with a verification code

  2. Exchanging a verification code for an access token. There are required params to make the exchange:

  • client_id - issued when you created your app (required)
  • client_secret - issued when you created your app (required)
  • code - a temporary authorization code (required)
  • redirect_uri - must match the originally submitted URI (if one was sent)
    As result you will receive the following object:
{
    "access_token": "xoxp-23984754863-2348975623103",
    "scope": "read"
}

The access_token then should be used as a bearer token. Request header example: Authorization: Bearer xoxb-1234-abcdefgh

See also https://api.slack.com/legacy/oauth#authenticating-users-with-oauth__handling-multiple-authorizations__appending-scopes docs on appending scope allowed for the token.

Slack oauth docs: https://api.slack.com/legacy/oauth
UPD: we may use our airbyte server for the developers to generate the tokens pair. See https://www.loom.com/share/a8f50cba13fd42a9ad775001f7707d52

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

Successfully merging a pull request may close this issue.

4 participants