Generate User Token for Bubble Data API

We want to import/export some data (e.g. books and orders) from Bubble to a 3rd party app. We are using the Bubble Data API for this. We have two options for authentication here as far as I know. The first one is the Admin Access Token, the second one a User Access Token. We would prefer the User Access Token, due to privacy and security. As fas as I see it the only option to generate this is, to use the Username and Password. We dont want the user to put in the Password though every 12 months and we dont want to store the password in plain text as well. Is there a other option to generate these tokens and handle the Authentication alone?

Funny you should ask as I’m researching the same thing. I was looking at this article: As a User - Bubble Docs

The issue I have is we don’t use email/password but rather OAuth with Microsoft/Google. I’m not sure how to implement this.

Have an api_key field (text), and key_expiration_date (date) on the User datatype. When they login, have it check if the expiration date is empty or older than the current date/time, if so run the API call to generate a new key using the email and password input boxes, then store the result.

For @treb.gatte , no clue :rofl:

3 Likes

Thanks for the great tips @tylerboodman . As far as I can see that, this makes it still necessary though for the user to re-enter his credentials every 12 months. Is that correct?

I know what you mean. As far as I understood the Bubble docs you can only do this with the bubble native sign in process. We are using Google OAuth as well. If anybody has a solution for this, I would be really glad, if he could share it.

Yea, I figured they would be signing in every day or something and you can keep the token fresh. But if they are also signing on once a year then correct.

Maybe it’s good they at least sign in. yearly??