Forum Academy Marketplace Showcase Pricing Features

How do I log in a user to my bubble app through the Data API?

Hi, I want to create a Data API where certain users can access some of my bubble app’s data. For that I guess I would have to create some privacy rules specific for each user.

In addition, I would have to to log them in through the Data API workflow in order to make this privacy rules aplicable for them.

However, to log them in I would need to know their passwords (which I don’t know and shouldn’t know).

So, how can I restrict access through the Data API to certain users if I can’t log them in (since I don’t have their passwords)?

With the way Bubble is set up, the Data API will always be available to everyone. However, Privacy rules will control who can access what.

Best bet would be to create a field called “type” or “role” on the User datatype. Then assign a role to those people. For Privacy rules, set a rule that if User has that type, then they have access to whatever fields you want to specify.

For logging in, you can create a Backend Workflow to log a user in and make them pass in email and password. Personally don’t recommend this though since it’s a security vulnerability for your user. Alternative is to set up an OAuth login flow but that might be a bit complex depending on your familiarity with that.

When you say “make them pass in email and password”, do you mean ask them to type their password and email?