Connexion to an app requiring PKCE code (and base64url encoded S-256 transformation)

Hello all,

I try to connect Fitbit App to Make (in order to have sleep data).

On this purpose (the Fitbit doc here : Authorization) :

  • I need to generate a PKCE code and a base64url-encoded SHA-256 transformation of this code. → with make it seems there is no base64url .
    → any solution to generate that code ? (I do not know Javascript)

  • then : when I make the authentification, I need to retrieve a code (that I will exchange for access token) and this code is stored in the redirect URI when I load Fitbit authorization page (like https://next.integromat.com/oauth/cb/oauth2?code=XXXXX#_=_) and I do not understand how I can retrieve it.
    Any idea on how we capture the parameters after the redirect URL ?

Thank you so much for any idea that can help me :slight_smile:

1 Like

Hi Marion,

Did you succeed or get any info on that ? I also want to connect an app using the PKCE code with Make :slight_smile:

Have a nice day

Hi @Nicolas3

Welcome to the Community!

Make handles the OAuth 2.0 authorisation model for you. Make will send the commands and store the tokens for you. The best place to start is by adding an HTTP “Make an OAuth 2.0 request” module to your scenario, and then clicking the “Create a connection” button. Make will then ask you for the URI, Scopes, Client IDs and other details specified in the Fitbit developer pages.

I recommend you try it without the PKCE code challenge first, because this is shown as optional in the Fitbit help pages.

Just one other tip: Do enable the “Show advanced settings” at the bottom of that window, because you will need to change the “Scope separator” to Space to separate the Fitbit scopes.

Let us know how you get on! If you run into any problems, try to screenshot them, post them here, and I’m sure the community here will help out.

2 Likes

Hi Terry,
I facing the following issue right now trying to connect my service to FitBit:

{"message":"The request failed due to failure of a previous request.","code":"SC424","suberrors":[{"message":"{\"errors\":[{\"errorType\":\"invalid_client\",\"message\":\"Invalid authorization header format. The header was not recognized to be a valid header for any of known implementations or a client_id was not specified in case of a public client Received header = null. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.\"}],\"success\":false}","name":"Error"}]}

I hope you can help me!
Best regards,
Louis

@Terry_Hopper
I guess I found the issue:
To obtain the FitBit Token you need a Basic Authentification:
https://community.fitbit.com/t5/Web-API-Development/Invalid-authorization-header-format/td-p/1363901

I guess its not supported (yet) in Make, right?

Best regards,
Louis

@Terry_Hopper @Nicolas3 @Marion
I found a solution for you guys:
Firstly as @Terry_Hopper mentioned: PKCE is optimal in the FitBit Case so dont worry about that.
Secondly: You need to generate your Basic Authenfitication from your Client ID and Client Secret and put it into the custom header section.

I achieved my first successful call with FitBit right now! :heart:

Best regards,
Louis

3 Likes

Oh wonderful !
I had left the problem aside but you make me want to get back into it :slight_smile:

3 Likes