Can a single user approach be used to access API data secured by Auth0?

Trying to create a single login for the application to access a secured API that is connected to auth0. A valid token must be passed in order to pull back the API data.

I have the 0auth2 user agent flow working, but this requires each user to be created and managed through auth0.

My goal is to keep the user management inside Bubble. If possible, then the backend logs into auth0, gets the token and it can access the API data as needed. Not much different than if you used a private key in the header.

Is it possible to do something like this on the backend?

You are looking for

1 Like

Has anyone ever done this in Bubble?

It sounds like you would have to validate the JWT file, save the token in the app (probably in private database table) then also have a routine to check and see if the token has expired…

I guess that is what the user agent flow handles in the other method.

Thanks again for your help!

Sorry, maybe this page will help you more

JWT is another way. This is not needed

1 Like

Going to take a closer look at this now! After studying up on the auth0 docs the last few weeks… starting to feel more comfortable trying this out. We have a M2M app configured on the backend already as well.

1 Like

Working on connecting. I can pull the token in postman using this same configuration, so I know it is setup to work. However, I cannot figure out how to setup the API connector to post the request and get the token. It keeps returning a 401 (unauthorized) error. It indicated the call back isn’t setup but I wasn’t sure what to put there. As well, why would postman work with same info & without that setup as well?

Here is the current config I am trying. Also tried to send it as JSON data and a variety of permutations of this. Always same error.

In Bubble, you should use custom.oauth token.

This topic was automatically closed after 70 days. New replies are no longer allowed.