Auth0 - How do I get the user info once logged in?

I am working on getting auth0 integrated into my app.

Per client request, I am trying to not to use the built in workflows or a plugin I am testing. I am trying to I call the login page directly from a url. That is working. After that step, it returns them to the callback page with the access token in the url.
/sign-up#access_token=....

From there, I need to login the user on the bubble app. I want to look up their email which I think I can find using this call:
https://auth0.com/docs/api/authentication#user-profile

I am also not sure how I can format the API call correctly here. This is from the docs. They want to pass a param that has the access token in it, but with a prefix "Bearer "

GET https://site-staging.us.auth0.com/userinfo
Authorization: ‘Bearer {ACCESS_TOKEN}’

I am having trouble getting the API call to initialize, always getting a 401 error or then it started saying “There was an issue setting up your call. undefined error: this header name is not correct undefined” … Have tried several options for the headers / parameters.

Another try:

You should use oauth2 process. why do you use self handled?

I am having trouble configuring the oauth2 process here. If you use that process, how do you know what the access_token is or where it is held? For example, when I want to call this userinfo endpoint, how is that setup using that method?

This is the first one I am trying to setup this way. To summarize where I am stuck - Once they login at auth0, I am unsure how to create the user in bubble.

Trying to use conditional logic to pull that variable from the url. Was also testing a plugin but the client doesn’t want me to use a plugin here. As well, the method it suggested using wasn’t working for me here.

Have read so many docs here but just can’t figure it out.

You don’t need to care about access token if you use Bubble oAuth2 user-agent

Bubble will handle API call authorization for you.

1 Like

Thank you, I went back to using this and was able to pull up the API calls I mentioned (get user info) for example. I am interested in the mods you made the to login dialog redirect… is redirect_to the last variable you set in there?

redirect_to is set to the bubble generic redirect url

1 Like

I liked how that worked, I am using it.

I was wondering how you would access the ID token that is granted. I am working on the logout function now and see in the docs that it is one of the params to send if I am not mistaken.

When you add a call in the API connector once you have set the auth correctly, you don’t need to set the authorization header because bubble will do it automatically for you.

1 Like

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