Having trouble connecting to an API protected by auth0

Trying to connect to an API hosted at AWS that is protected with Auth0.

Got it working yesterday on the backend by making a button in bubble that used the “Signup/login with a social network” function then pointed it at the API configured in the screenshot below. When I clicked it, it worked. The line in my screenshot in the API connector plugin changed and I was able to start work. It worked for one day before the token expired. However now, I cannot seem to make that same button work to get another token.

I have logged out as well, which I was hoping would help when I logged back in. I didn’t, I have tried several times and I can’t get rid of that line where it says “Your token is not valid any more. You should sign up again in run mode to get a token to set up and modify your calls”

The crazy part is that even while the API connector isn’t connecting on the backend, on the front end, the user can still see the API calls and API data is showing on the page. I think this is because we are using the SSO login and it appears the token is being issued correctly there.

Need to figure out how to re-authenticate the backend into the API. Been reading the docs all day but didn’t make much progress. How can I get the API connector working again?

I used this page as a reference when setting up parts of the process.
(I used Chrome to translate the page which helped a lot)
https://blog.nocodelab.jp/entry/auth0-sso#4-5Auth0アプリの設定

Also saw this recent thread. It mentions saving the tokens in the DB. However, I am not sure if this will help resolve my issue. Just wanted to post it for reference as well:

When calls are initialized in API Connector, it doesn’t matter if the token for API Connector is expired. Bubble will not refresh it, but your API Calls work. If you need to reauthorize API connector, be sure to be logged out before using signup with social network in debug mode in dev.

1 Like

That is exactly it! I need to re-auth the API connector.

Funny thing is that I have been doing what you are suggesting. Your post made me think about it a bit more. I just cleared all cookies and it actually triggered the auth0 login popup again, which it wasn’t showing the last few tries. Once logged in I hit the refresh token button which got it working the last time, but it didn’t work at first.

After reviewing your message I realized somehow I wasn’t in debug mode. I made sure that was in the url and bingo … it is working again. I saw the popup that indicated it was issued.

Thank you so much!!

1 Like

Hey, after reading your post here and in Auth0 forum’s and after some head scratching i’ve finally managed to make bubble generate the token and connect to my backend using it. But now im facing this issue with the token expiration, could you share more details about it? Have you manage to refresh the token without needing to authenticate again in debug mode?