JSON No Code Connector - Base64 Encode and Basic Authentication?

DomoDork
DomoDork Contributor

Hi All,

Does anyone know how to use the JSON No Code (or any of the JSON connectors, really) to do basic authentication via a client id and secret where the client id/secret are base64 encoded?

Based on the API documentation, I need to pass the following header where the client id:secret string is base64 encoded.

Authorization: Basic <client id:secret>

So what I did was take the client id:secret string, and ran it through base64encode.org so I ended up with the following:

However, when I try to get a preview, I get the following error:

When I do my own manual curl request via command line, I get back data. So I'm not sure if I'm leveraging the JSON connector correctly. Any help would be greatly appreciated.

Tagged:

Answers

  • Is that word "Basic" supposed to be in the authentication value? That doesn't look like part of the base 64 string.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • DomoDork
    DomoDork Contributor

    @ArborRose according to their python API sample, it should be "Authorization: Basic <base64 encoded id:secret>

    Looking at cURL documentation, this is the correct and expected way to specify basic authentication in a header:

    curl \
      --header "Content-Type: application/json" \
      --header "Authorization: Basic $AUTH" \
    

    So in theory, what I have setup in the json no code connector should work.

  • ellibot
    ellibot Contributor

    @DomoDork did you fill out this section where the client id is the username and secret is the password?

  • DomoDork
    DomoDork Contributor

    @ellibot yep, sure did :)

  • Here's the way I do it in Python. In your comments, you use "Authentication". But in both of our code examples, we're showing "Authorization".

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • DomoDork
    DomoDork Contributor

    @ArborRose - I caught that and changed it right after posting. Still getting the same result. Looking at the network inspector what I seem to be getting back during the preview is an internal server 500 error from domo went it tries to execute the curl command.

    Starting to think I need to go back to the client and see if maybe the way they set things up for my auth is incorrect or something. I'll keep messing with it.

    Thanks for the help!