Bubble.io is a no-code platform that non-developers and developers can use to build apps. We found it to be quite easy to use and extremely powerful. It has plugins and an app ecosystem to make sharing code easy. It also has numerous useful foundational components like an OIDC client that made it easy for us to build a foundation for others to use in their apps.
It is handy as a prototyping platform and can host real production apps. This tutorial will show how to integrate Beyond Identity's Secure Customer passwordless authentication into your bubble.io app.
You can visit a Demo Application to see one in action.
The user flow to set up a passwordless account is as follows:
User enters a username and email address and clicks Sign up and Bind a Credential.
Application creates an identity and sends the user a credential-binding enrollment email.
When the user clicks the link in the enrollment email, Beyond Identity uses WebAuthN to create and bind a credential to the user's current browser.
The user can log in now and in the future with their email, which triggers a step-up (on most devices) and retrieves the credential.
That credential is presented to Beyond Identity to authenticate the user.
Beyond Identity plugins
There are two plugins you can use for bubble apps. Before use, you must customize them with the tenant, realm, and client id/secret of your own Beyond Identity application.
Beyond Identity Customer AuthN: Performs the authentication flow after initial signup.
Beyond Identity Customer Mgmt: Helps perform user management. In our demo application, it is used to create a new identity and send a Credential Binding request to the email address on record. This plugin can also be used to retrieve a list of identities for the current tenant.
You can see these in action in the Demo App that is linked above.
Before you get started, please set up the following.
A free account on bubble.io and some basic familiarity with their UI
A free account in your region on Beyond Identity Secure Customer
You must select Client Secret Post for the Token Endpoint Auth Method in your application.
A bubble app.
Add the Beyond Identity plugins
Once you have created a bubble application, you'll see the New Application Assistant.
Click through the assistant's steps until you reach the Install Plugin page. Then click Install Plugin.
In the upper left, click Sort by > Name and search for Beyond Identity.
Click install for the Beyond Identity Customer AuthN and Beyond Identity Customer Mgmt plugins.
Here are the direct URLs to the plugins as well:
You do not need the API connector for BI services, but you may wish to use it to integrate with your other services.
Configure the plugins with values from Beyond Identity
This step involves copying OIDC and client/secret values from the Beyond Identity Admin Console into the bubble's plugin configuration page.
Customer Mgmt plugin
This plugin manages identities and credentials, and more.
You must create and copy an API key from the Beyond Identity admin console to use it.
In your bubble.io app, click Plugins > Beyond Identity Customer Mgmt.
you'll need an API token from the Beyond Identity Admin Console for the Authorization token.
Log in to the Beyond Identity Admin Console.
Ensure you're logged into the Beyond Identity Admin Realm and select Applications > Beyond Identity Management API > API TOKENS.
Create a new token and name it bubble io plugin or something you choose.
Copy and save that API token in a text editor because you won't see it again.
Go back to the bubble.io plugin configuration page. In the field for Authorization (shared headers), type Bearer and then paste your API token from the previous step.
In the Beyond Identity Admin Console, ensure you're in the new realm you created in the prerequisites.
Click Edit realm and copy the TENANT_ID and REALM_ID into the bubble.io plugin's configuration page.
Customer AuthN plugin
This plugin uses OIDC to follow the Authentication (AuthN) flow.
In your bubble.io app, click Plugins > Beyond Identity Customer AuthN.
In another tab or window, open the Beyond Identity Admin Console and navigate to the new realm you created in the prerequisites.
Next, navigate to the application you created under Applications.
Paste the Client ID into bubble.io plugin's App ID/API Key field.
Paste the Client Secret into bubble.io plugin's App secret field and into the API_KEY field.
Create a user signup flow
This flow will enable a new user to input their username and email address and create a new identity. It will also send a credential-binding email to the new user's specified email address.
Once you're in your new app and on the page you want to add the login flow to, add two Input fields:
Username (content format: Text)
Email address (content format: Email)
Label each box with a Visual Element > Text for Username and Email address.
Add a Button for Sign up and click Start/Edit workflow.
For the first action, click Account > Sign the user up, which creates an entry in the local database for the user.
Add a second action. Click Plugins > BI Secure Customer User Mgmt - Create User.
Enter the TENANT_ID and REALM_ID copied from the Beyond Identity console Home > Edit Realm.
In the email_address field, remove the existing text and click Insert dynamic data > Input Email's value.
In the display_name field, remove the existing text and click Insert dynamic data > Input Username's value.
In the username field, remove the existing text and click Insert dynamic data > Input Username's value.
Next, you'll call the Beyond Identity API to send a credential-binding email to the user.
Add another action with Click here to add another action > Plugins > BI Secure Customer User Mgmt > Send Credential Enrollment email.
In the IDENTITY_ID, delete the existing text, and click Insert dynamic text - "Result of Step 2's body id.
Replace redirect_uri with the expected URL of your hosted app.tip
You can edit this field later if you don't yet know the final URL. If you leave it as localhost, the Credential Enrollment portion will attempt to redirect you to localhost.
Replace the authenticator_config_id with the value from your Beyond Identity Admin Console at Applications > <your_new_app> > Authenticator config -> Authenticator config id.
At this point, you can tell bubble to redirect to a page confirming authentication with a text field, redirect back to the index, or do nothing.
(Optional) Create another page that tells the user to check their email and hit the credential enrollment link to complete the signup.
Set up the login button
For users who have already signed up and enrolled in a credential, you'll create a Login button because they'll need to enter their email address.
Create a text field and title it Existing user email address.
Create a button Login and click Start/edit workflow.
For the first action, select Account > Log the user in. For Email, use Input Existing user email's value, and the same value for the password. Upon user login, this will set up the browser session and update a row in the app's local database.
Create a second action to perform the OAuth login. Click to create a second action and select Account > Signup/login with a social network.
In the popup, select Provider > BI Secure Customer AuthN and click Add API Key.
Copy and paste the App ID and App Secret from the Beyond Identity Admin Console.
Applications > <your_new_app> > Client ID should be pasted into App ID/API Key
Applications > <your_new_app> > Client Secret should be pasted into App Secret
Preview the site
In this step, you'll preview the site, correct any visual design problems, and copy the bubble URL back into the workflow to enable the Beyond Identity web authenticator to redirect to your application after it has bound a credential to your devices.
In the bubble.io editor, click Preview in the top right corner of the screen.
Copy the URL of your preview app.
Paste that URL into the bubble editor: Workflow > When Button Sign Up is clicked > Step 3 - Send Credential Enrollment email > redirect uri.
Add that URI to the permitted list of redirects in the Beyond Identity Admin Console.
From the Beyond Identity Admin Console, go to your new application.
Paste the URL of your preview app into the Redirect URIs field, add the suffix /api/1.1/oauth_redirect, and click Submit.
For example, https://bi-guide.bubbleapps.io/api/1.1/oauth_redirect. You can have multiple URLs here.
Click the Design editor and fix any UI issues and close the browser tab for the older preview.
Click Preview again.
Sign up a user
Enter a username and email address (they can be the same). Then click Signup.
It creates a new identity in the bubble.io app and the Beyond Identity tenant and realm.
It sends you a credential-binding email at the address you specified.
Click that link to bind a credential to your device.important
Do not use an Incognito/private browser for this; your credential will be created and discarded.
Log in the user
Visit the main page of your app. Again, don't use an Incognito/private browsing window, or the credentials will be discarded.
Enter the email address you used in the signup process and click Log in.
Observe the browser step up and verify it with biometrics if prompted.
You'll be redirected back to the bubble.io app home and see that you've been logged in.