Authentication in packs

Hey there! I’m trying to create a pack for The Noun Project (connecting its API to pull in Icons)

The Noun projects API requires an api key and a secret.

How do I account for that when creating the pack?

I tried pack.setUserAuthentication and then using the HeaderBearerToken type, but that only allows a user to input an API key and not a secret?

Thanks! Any help is appreciated - and keep in mind I’m completely new to writing code and APIs

Figuring how to map an API’s auth requirements to what Coda Packs supports is certainly a tricky exercise. Looking at their docs, they seem to use the OAuth 1.0a flow:

The API is secured with OAuth 1.0a. You must use your client key and secret to sign requests when accessing the API.

Unfortunately Coda doesn’t currently support OAuth 1.0a, only the newer OAuth 2.0 version. Additionally they seem to use a non-traditional form of OAuth 1.0a where there isn’t actually an access token obtained.

If you plan to use the same credentials for all users of your Pack you may be able to hard-code your key and secret and generate the appropriate OAuth1.0a signature, but it’s a bit of a chore at best. If you wanted to have each user to enter their own API key then unfortunately this isn’t possible with Packs today.

Got it got it - Seems a bit over my head for now! Was more using this as a test case for myself to learn more about building packs, authentication, etc.

So if it would “be a chore” to generate the appropriate OAuth1.0a signature I think ill move on to another project!

Thanks @Eric_Koleda - Really appreciate it

1 Like