API Connector: Understanding Oauth2 Custom Token method

In the documentation for Oauth2 Custom Token this is all the info I could find.

Does that mean that the data returned from the API you’re authenticating with, needs to be in this format:
image
Or should a format like so work as well?
image

1 Like

Second one will also work

That is good to hear. Although now I am confused as to why I am getting this error then.
image

This is how I’ve got it setup. And I’ve manually tested it elsewhere to verify it works.

I don’t think the second one will work. It’s not a standard oauth2 process. the access token need to follow data path, something that Bubble will not do.
Can you share API doc?

Oh, so the response needs to be flattened then? The API is currently in development so it’s not quite publicly available yet.
The authentication process involves sending the client_id and client_secret in the body and then the response is formatted like so
{
“data”: {
“access_token”: “…”,
// …
}
}
I am in contact with the developers of the API and potentially might be able to ask them to modify it. I can set up a manual handling process if needed, but would much prefer to let bubble handle it for me.

they should follow standard oauth payload. This is not just for Bubble, but for any other tools that have similar function.

However, you can manually do the process if needed using auth: none and do a call to get the token. Set a scheduled WF or check date to request a new token when needed. You need to store date, token and refresh token in DB

Normally,custom oauth2 token is for client_credentials oauth workflow.

Yeah, it seems like they have a similar but not exact setup. I’ll talk to them about changing it to fit the standard, thanks!

1 Like