Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Oauth2.0 Authentication - How to get the code from the url

kennethli
8 - Asteroid

Hi,

 

Recently I am developing a connectors which using Oauth2.0 as the authentication method.(OK, I know there are a lot of APIs are using Oauth2.0)

 

The procedures are basically like below:

1. Register an App and get Client ID/Client Secret/Redirect Url

2. Use the Client ID and Redirect Url to retrieve a "code" (required for every request made)

    The code returned on the url: http://[Redirect Url]?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

3. Append the code, Client ID, Client Secret and encoded Redirect Url to generate the "token"

4. Put the "token" into the header and make request to retrieve the data

 

My question is how to retrieve the code from the Url through Alteryx?

I downloaded the data with 

'https://login.mailchimp.com/oauth2/authorize?response_type=code&client_id='+[Client ID]+'&redirect_uri='+[Redirect Url]

but the content downloaded seems do not include the "code".

 

I refered to the google analytics/twitter tools but the concept seems a bit different....

Does anyone come across similar problem or any work around on it?

Thanks. : ) 

6 REPLIES 6
TashaA
Alteryx Alumni (Retired)

Hi @kennethli

 

The process you are describing is a web-server grant flow. This is meant for use if you have a web server with the ability to receive incoming HTTP requests. Currently this is not something that is really possible when building a pure Alteryx connector. 

 

 

I looked around in the MailChimp documentation and it looks like you can use Basic authentication instead of OAuth (need to check if this is still supported). My authentication blog post covers the implementation of Basic, as well as other types of authentication that lend themselves to use within Alteryx workflows. 

 

http://developer.mailchimp.com/documentation/mailchimp/guides/get-started-with-mailchimp-api-3/

 

-Tasha

kennethli
8 - Asteroid

Hi Tasha,

Spoiler
 

 

Haha, actually I did created a workflow with basic authentication and it works.(Thanks to your post, that's really great!!!)

And I am wondering if it is possible to create a more generic workflow for Oauth2.0 which can be easily converted to other APIs.

Since the basic authentication would require to put the token into header which may not be able to convert.

 

One more thing, you mentioned  "web-server grant flow", so is there other flows that I can use with Alteryx to build an authentication for Oauth2.0?

Thanks.

 

TashaA
Alteryx Alumni (Retired)

Hey @kennethli

 

That's great that you were able to get it working using the Basic Authentication. 

 

Another implementation style of OAuth2.0 is the Client-Credentials grant flow, this means that the application that you register with the service is directly tied to resources that you are the owner of. You register an application, and in return they give you a client id/secret or an api key that is directly tied to your account. Most often this is accompanied by an endpoint that you can use to send these credentials to in exchange for an auth token, this can all be done in the Download Tool. 

 

-Tasha

poojitha4
8 - Asteroid

Hi Tasha,

 

I am currently working on something similar mentioned by @kennethli, since I am working on YouGov APi and they are moving away from the basic user-password authentication. And I need to get working on OAuth2.0 . Is this still not possible on Alteryx?

 

 

nverma7
5 - Atom

Hi Tasha,

 

Thanks for the posts Tasha :)

I am trying to get the access token using client id and secret but getting the invalid client error.

 

Please assist.

 

Thanks

Naren

rd916
6 - Meteoroid

Hi @poojitha4 ,

 

Do you know if this is now possible to do in Alteryx?  I have not seen any updates or fixes in other discussion boards.

Labels