For last option - I’ve already created data privacy rules, based on the Built-In “Creator” field that is available on all “Things”. So unless there is no other way, I want to avoid using a custom field for this.
It is not clear to me how to use API workflow to log the user in.
After reviewing the documentation, I used Postman to test what I understood from the documentation.
I used the API Token that I generated in the Settings Tab - API section for Authorization.
My API workflow is available on open app for forum questions here, the endpoint is called “flight”. The thing updated is also called “Flight” and contains three fields.
My use case is this: An external app has the same users as my bubble app (match based on email address). When the external app sends data to my bubble app (payload includes user’s email) , I want to create / update a thing in my bubble app as my user (using my user’s credentials).
I have:
Enabled "This app exposes a GET/ Data API on thing “User”
So first thing, you have errors in your workflows (see the red in the screenshot attached), so i CAN’T work. The first step to debug is to make sure you don’t have errors.
Second, what is the logic in your workflow? Why do you need to log the user is? If sounds like you just want to create a flight. If you want the created by to be the current user you’ll need the API token as I said earlier, but it’s a bit complex as you need people log in. I would just run the workflows with your admin private key.
Yes, you are correct. I have corrected the errors in the workflow.
Yes, you are correct. I do not need to log in the user. I only want to create a flight and the created by to be the current user.
It is not clear to me how I specify the current user if I use my admin private key. I called the endpoint and ran the workflow using postman. I set the Authorization in the header using the admin private key.
If you run things with the private key, the creator is the app owner (admin), which is not a user of your app per se, so the field will look empty. If you want to save a user, you should put this in another field.
If there no other option available, I’ll go with your suggestion. I’m reluctant to implement it this way - store in another field - since it is not very “clean”.
From your explanation of API token, it looks like it needs the user to really log in. I do not want to do this, because it does not make sense in my use case.
Is the following possible?
STEP 1: I use my admin private key to get the authentication key of a user (does this exist?).
This would be similar to how UBER and others enable external apps to use UBER features on behalf of UBER’s users. In the UBER like scenario, they use OAuth. In my scenario, I do not think I need to do this since I’m the admin/owner of the my bubble App.
STEP 2: I use the authentication key of the user to create a flight on their behalf.
All want to do is to create a flight and the created by to be the current user. The matching is based on the email address which is available in the payload.
Is there any way to do this without creating a new field?
How do we proceed with “logging into Bubble” via our webview in a native app? Do we pass the user_id and token in as headers of a new Authenticated API call along with the stored username and password?