airbyte icon indicating copy to clipboard operation
airbyte copied to clipboard

Source Typeform: support oauth

Open cheyura opened this issue 4 years ago • 3 comments
trafficstars

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

The connector supports oauth webflow authentication with client_id/client_secret in a backwards compatible manner Oauth properties are annotated properly. See this PR for an example

cheyura avatar Nov 10 '21 13:11 cheyura

Solution for access token finished. But expiration time for an access token is only 7 days. Blocked on getting refresh token from API https://community.typeform.com/developers-corner-44/errtokeninvalid-during-access-token-exchange-request-3745

lazebnyi avatar Nov 29 '21 12:11 lazebnyi

It looks there has been some progress in the Typeform community regarding this issue. Can the assignee revisit this one and check if this is still blocked, please?

YowanR avatar Jul 21 '22 17:07 YowanR

hey @YowanR I have just checked: no progress unfortunately. I've made a request to the /authorize endpoint, then to the /token according to the docs. The latter one responded with an error @lazebnyi had reported earlier: {"code":"bad_request","description":"Bad Request: bad request: {\"code\":\"FORBIDDEN\",\"description\":\"Forbidden: this kind of access tokens cannot have refresh tokens\"}\n","help":"https://developers.typeform.com/get-started/authentication/"}

davydov-d avatar Jul 29 '22 13:07 davydov-d

@davydov-d is there any other workarounds or are we blocked here? Cc @misteryeo

YowanR avatar Aug 03 '22 22:08 YowanR

@davydov-d is there any other workarounds or are we blocked here? Cc @misteryeo

@YowanR I'm afraid we are blocked here. The default lifetime of an access token is 1 week, this means user would have to reauthenticate every week since we can not get a refresh token. I see no workarounds here

davydov-d avatar Aug 04 '22 07:08 davydov-d

Thanks @davydov-d ! To make sure I understand, is this similar to this github issue here?

YowanR avatar Aug 04 '22 20:08 YowanR

@YowanR great finding, I was sure we do support persisting new refresh_tokens. Now, to be clear we are blocked by two things here:

  • TypeForm API deffect
  • #3990

davydov-d avatar Aug 05 '22 11:08 davydov-d

Linking https://github.com/airbytehq/airbyte/issues/3990

evantahler avatar Aug 30 '22 15:08 evantahler

Typeform still raises error during the oauth process: image

artem1205 avatar Dec 02 '22 15:12 artem1205

Update: To make it work as expected we need to change the token expiration period to one week. image After that we may apply param scope=offline and obtain refresh token, as well as refresh it later. image (1) image (2)

artem1205 avatar Dec 06 '22 21:12 artem1205

@artem1205 Why was this moved back to Backlog(Unscoped) ? As I see it, we have a path forward, correct? cc @lazebnyi

YowanR avatar Dec 09 '22 18:12 YowanR

@YowanR, yes, you are right, Typeform is unblocked now, oauth can be implemented.

artem1205 avatar Dec 09 '22 19:12 artem1205

@artem1205 Thanks! Moved this back to in Progress. @lazebnyi Are we still able to land this during the sprint?

YowanR avatar Dec 09 '22 20:12 YowanR

@YowanR @lazebnyi Issue is blocked since the connector uses single-use refresh token, which requires proper processing from platform side

midavadim avatar Dec 16 '22 11:12 midavadim

For Typeform, OAuth is not required to have this connector on Cloud. We will be moving forward without OAuth until we get the UI changes in. @midavadim Can you confirm?

YowanR avatar Jan 12 '23 22:01 YowanR