You are viewing limited content. For full access, please sign in.

Question

Question

Using OAuth 2.0 with web requests. Should there be an option to encode in base64?

asked on April 13

I was trying to use the OAuth 2.0 feature of the on-prem workflow and kept getting an unauthorized response.

So I called the token endpoint with default authorization and the credentials in the headers where it said the credentials were invalid. I asked chatgpt what in the world was going on and it said you need to encode your credentials into a base64 string like this

That did the trick.

Should there be a checkbox here to encode to base64 when using OAuth 2.0. I would rather not have to call the token endpoint in a separate http request as it doubles the amount of request activities.

0 0

Answer

SELECTED ANSWER
replied on April 13

Hi Chad,

In the latest released version of Workflow, there is a new option "Client Authentication" for OAuth 2.0 authentication. You may select "Send as Basic Auth header" and enter the encoded single string value in the Client Password input.

1 0
replied on April 14

I see, interesting. So if I choose this option, I put the encoded username:password in the password field and it works as normal. That will do the trick. Not sure why I never came across this need before with all the APIs we hook up, seems like Paypal is breaking the mold.

0 0

Replies

replied on April 13

To clarify: the OAuth 2.0 authentication did work after base64 encoding the Client Secret; without needing to call the token endpoint in a separate http request. Correct?

P.S.  "Base64 encode" checkbox next to "Client Secret" would be a nice to have, but there are plenty of tools to do that.

0 0
replied on April 13

No, because you must encode both the id and secret separated by a colon character as a single base64 string. There is no where in the OAuth2.0 config in Workflow to enter that single string value. That is why I am wondering if this option needs to be added.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.