We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx DCM usage within the Download Tool (for generic API authentication)

markspivey
6 - Meteoroid

I'm working on updating an existing set of projects where I need to use the Download Tool in Alteryx to access various APIs, and wanted to securely store the credentials in DCM, rather than having them sit insecurely within the Download Tool itself. We can use access to the Okta API as an example, whereby the Okta API requires an API key which is typically passed in the HTTP headers as part of an API GET request. My goal is to securely store the API key and manage it through the Data Connection Manager (DCM).

 

I've set up DCM and understand how it can store and manage credentials like username/password pairs and specific methods for AWS and Azure services. However, I'm having trouble understanding how to use it for storing and managing generic API keys or credentials, which don't fit into these pre-existing categories.

 

In my Okta example, the Download Tool needs to be configured under the Headers tab to push a Name and Value for authentication purposes, which for Okta looks like this:

 

Name: Authorization

Value: SSWS {apiKey}

Raw: Authorization: SSWS {apiKey}

 

My issue is figuring out how to store this API key in the DCM and how then to reference that secret/variable in the Download Tool. Has anyone used DCM for storing generic API credentials specifically for use within the Download Tool for API access?

21 REPLIES 21
Sakeen
5 - Atom

Hi bkclaw113,

 

I hope you're doing well. I came across your answers to the problem in the "Alteryx DCM usage within the Download Tool (for generic API authentication)" article, and find it highly interesting.

 

Could you kindly send me a screenshot or let me know where to insert the grant_type = client_credentials parameter?

 

Your assistance would be greatly appreciated.

 

Regards

Sakeen

ayx104997
5 - Atom

@bkclaw113 
If possible can you please help us with the screenshot of the configuration of the download tool, basic header and payload tabs Also, please let us know how you encrypted the key. 

bkclaw113
10 - Fireball

Odd, I could swear that I posted those pictures yesterday in response to @Sakeen  but I do not see them anywhere. Hopefully it works this time.

Also here is a good post on doing Basic Authorization that is used in many API's - https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/API-Basic-Authorization/td-p/7... 

 

bc2c5838-cf28-4653-ac26-a0afffdd541e.pngHeader TabHeader TabPayload TabPayload Tab

noel_navarrete
6 - Meteoroid

Was wondering if you are getting a DCM Tag error when using "{dcm:password}" as Value in the Payload tab in the download tool...

 

I am trying to use DCM, but I am seeing that the {dcm:password} alias when used in the Payload tab causes the error. I followed the documentation for the Download tool (screenshot attached) but had no luck, maybe I missed something.

 

Removing the client_secret from the “From the following constant values” and ticking client_secret in “And values from these fields” the workflow runs fine.

 

Any help is much appreciated. 

 

 

bkclaw113
10 - Fireball

@noel_navarrete , what version of Alteryx are you using. I saw that there were some changes to the Download tool in 24.1, and I have not tested any of what I described against those new changes

 

"Download Tool Updates We’ve extended the support for DCM tags resolution in the payload for POST requests inside the Download tool. Also, there’s added support for Base64 encoding of header and payload values (or selected parts of it) inside the Download tool."

 

 

Also have you tried using Content-Type (on the payload tab) of application/x-www-form-urlencode? That is what I typically use.

noel_navarrete
6 - Meteoroid

thanks for the quick revert.

unfortunately we are still on 22.3.

I did try that "application/x-www-form-urlencoded" setting but i still get that DCM Tag error. 

I will try to download and use the latest designer version, but wont be of any use as our gallery is still at 22.3

 

Cheers!

TonyAdam
8 - Asteroid

I found the solution in the Alteryx_Server_Usage_Report, which uses a dcm for the Gallery API and adjusted it for my use case. I can confirm it works in 2024.1.

 

In our case we need to connect to https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token. The actual tenant_id must be included in base URL of the DCM "URL for Downloading" connection. URL from the Input anchor must be a blank otherwise it will concatenate with the URL from the DCM.

 

Header:

Content-Typeapplication/x-www-form-urlencoded

 

For the POST select "Use Following for Query String/Body" (adjust scope= for your use case):

scope=&grant_type=client_credentials&client_id={dcm:userName}&client_secret={dcm:password}

noel_navarrete
6 - Meteoroid

Thanks TonyAdam.

Our company upgraded our Alteryx to 2023 and the download tool worked as designed.

 

Cheers!

montynasser
6 - Meteoroid

do you have sample workflow for this, trying to follow your instructions but i am getting the error 

 

Download (1) URL using bad/illegal format for https://login.microsoftonline.com/{{my tenant id}}/oauth2/v2.0/token

 

TonyAdam
8 - Asteroid

I don't think there is a useful way to share an example WF without a DCM or sharing credentials.

 

According to the error, you probably have to replace the tenant id, with your actual Id.

 
 

DCM Connection.png

DCM Credential.png

Labels
Top Solution Authors