# Bubble

### Login to Secqure

#### Create KEY\_ID for your Login Form

1\) Login to Secqure Dashboard from <https://www.secqure.io> and click on "[Dashboard](/setup-configuration.md)"

2\) Once Logged-in Create a [New Project ](/setup-configuration/project.md)from Dashboard by clicking "New Project"

3\) Select your newly created Project and copy your project Key\_ID

4\) add style, logo, text to your login form under Project >[Design](/setup-configuration/design.md#style-your-login-form)

5\) You can customize the email link content under [Custom Email](/setup-configuration/configure-magic-link-page-custom-email-and-sms.md#custom-email)

6\) Add this Key\_ID in your installed Secqure Plugin  in your Bubble.io App&#x20;

{% hint style="info" %}
**Note:** If the login form does not show up after following the steps mentioned in the [Bubble Setup](#bubble-setup) or you received an error message "something went wrong", the likely cause may be incorrect URL configuration. You can add your test or live url correctly from [Project Setting>Web URL](/setup-configuration/project-setting-domain-and-session.md#web-url). You can add multiple URLs with comma-separated.

Example: For bubble test URL <https://myauthtest.bubbleapps.io/version-test> , add the Web URL as <https://myauthtest.bubbleapps.io>
{% endhint %}

### Bubble Setup <a href="#bubble-setup" id="bubble-setup"></a>

The below section provides  step by step guide to integrate the Secqure Login form to  home page (Index) and a members-only page (Protected).

#### Install Plugin

Go to the Plugins tab of your Bubble application design view. Click on Add Plugins  and search for "**Secqure**" or "**Secqure Passwordless Login"** as displayed in the below screen and install.

![Install Secqure Passwordless Login Plugin](/files/zAwhQv6ZUlOqbvnJVWuq)

#### Add API Key\_ID

From the Plugins tab, click Secqure Passwordless Login, and enter your Secqure Project Key\_ID as mentioned in [#login-to-secqure](#login-to-secqure "mention").

Keep the Key\_ID-dev field blank.

It's suggested using the latest version of the plugin to keep up-to-date on all Secqure's new features.

![](/files/nS4kGWIiPvswRtfPm6xK)

#### Secqure Login Form

Once  the plugin is installed successfully, you can find the "**Secqure Login Form**" under the **Input form** in the Design Tab

![](/files/tRJJert5A2MVYi7DLEZ2)

#### Index Page

Drag and add the Secqure Login Form to your index page. A login form would be visible as shown  below.

![](/files/6agSDVSSJYGcxfL3GkTw)

#### Protected Page <a href="#protected-page" id="protected-page"></a>

Create a new page called  **Protected** .

Select **Add a new page** by clicking on the top left corner above the **Design** tab as displayed in the below screen.

![](/files/kVXULJ61VdS4ezLtrLNa)

* Add a "**Secqure Protection**" component to make this page protected. Find and Drag it from the left panel under the **Visual Elements**. &#x20;

![](/files/dY3jt0wZ8u7q0iMNKxIj)

**Welcome Logged-in user**

Add a text element and select it's value as SequreProtection A's identifier. which will show the logged-in user's email or phone number.

![](/files/3lmgRPhD8OkTOwMpOAbd)

**Show Protected Content**

Add a group from **Containers** and change the name "Group A" to **Group Logged-in** by clicking on the top part of the grey box as shown in the screen below.

![](/files/Q7LG6iGIVP4E1Y0BOKqT)

Add all your protected content in that group, including text, buttons, images, and containers. Make sure to <mark style="background-color:yellow;">uncheck "This element is visible on page Load"</mark>. The workflow logic will be added later to make sure it is visible on successful login. In this example we have added text element as "You are Logged In : Members Only View".

![](/files/AEZUJSYP5uwnJZ4EGGMa)

**Show not Logged-in Content**

Create another Group and name it **Group Not Logged-In** , just like previous one.

This group will be visible if you do not successfully log in. Add a text message saying "You are Not Logged In:Guest View" . Make sure to <mark style="background-color:yellow;">uncheck "This element is visible on page Load"</mark>.&#x20;

![](/files/gYyKphe0tNpeRlnp4Zta)

#### Login Workflow <a href="#login-logic" id="login-logic"></a>

Let's add the worflow steps for index page and protected page.

**Index Page**

Once user logged-in from index page we want to re-direct them to the protected page.

Navigate to index page, go to workflow tab and add an event.

Add a new element: **Elements >&#x20;**<mark style="background-color:blue;">**A Secqure Login form - User Pressed Login**</mark>

![](/files/V8WTuRgR8cymxLoa7eYB)

&#x20;click to <mark style="background-color:blue;">**add an action**</mark> to Navigate to the Protected page

![](/files/RugA6PJw7ct86iu7eTAx)

* Select **Navigation > Go To Page** action to select **Protected** page as the destination.

![](/files/Gkz5u77vewchJHEAnUDn)&#x20;

**Protected Page**

Let's create a workflow to show the **Protected** content if the user successfully logged-in , else, show the **Not Logged In** content.&#x20;

* Navigate back to the protected page by clicking on the top left, and click workflow.
* Add an **Event** > **Elements** > **A SecqureProtection  is\_loaded**. This enables us to take action whenever the Protected page is loaded.
* Add an **Action** > **Plugins** > **Check User Logged-in**

![](/files/16VCFYf45dSiHFePKGF6)

* Set "*access\_token"* as **ThisSecqureProtection's access\_token**, "*identifier"* as **ThisSecqureProtection's identifier**

![](/files/5cPKIJXxT4hcCIYuzUXS)

### <mark style="color:purple;">Well done</mark> :thumbsup:, <mark style="color:purple;">You are almost there</mark> :clap:

Let's create the logic to show the protected content when the user successfully logged-in.

* Add another **Action** > **Element Actions** > **Show.**
* Then set the element as our Group Protected Content, and set **Only when: Result of Step 1 (Check User Logged-in)‘s logged\_in is yes.**

![Check User Logged-in is 'yes'](/files/oIg8jW7kDNnAZRbVnnDS)

To create the logic when the user fails to log in,

* Add another **Action** > **Element Actions** > **Show.**
* Then set the element as our Group Not Logged In, and set **Only when: Result of Step 1 (Check User Logged-in) logged\_in is no.**

![Check User Logged-in is 'no'](/files/QiunYGtqj40VR41w03jj)

#### Logout Button <a href="#logout-button" id="logout-button"></a>

Let’s create a logout button to log the user out of the website and redirect to index page.

* On the protected page, switch back to Design and  drag a button under the Visual element  and place on the top left corner of the page. Edit the button text as "**Logout**"**.**
* Make sure you <mark style="background-color:yellow;">uncheck "This element is visible on page load</mark>". We want to show this button only if the user logs in.&#x20;
* Add another action by clicking on the **Action** > **Element Actions** > **Show.** just like the previous one.
* Set the **Button Logout** as the element, and show **Only when: Result of Step 1 (Check User Logged-in) logged\_in is yes.**

This logic will display the button only when the user logged in.

![Show Logout Button Condition](/files/LHhvkRJillbum2AOkLmC)

### **Logout User**

Finally, let’s create the workflow of the Logout button.

* Go to **Workflow** and add another event **Event** > **Element** > **An element is clicked** beside the previously created event **A Secqure Protection is loaded** as shown  below.

![Add an event for Logout Button Click](/files/BHdk6oDFpfghrDDZMnLB)

* Select **Logout Button** as the element.
* &#x20;Add an action > Plugins > logout Then, we need to redirect them back to the home page.&#x20;
* Add an **Action** > **Navigation** > **Go to a page** under the same event and select the index page.

![](/files/CuME3QGJPd5jqd1xjqRT)

This will redirect you to the index page and log you out.

### Login button

We need to show this button only if the user is not logged-in.&#x20;

* Add a Login Button and uncheck “This element is visible on page load”
* Continuing with the workflow above, add an action > Element Actions > Show.&#x20;
* Set the Button Log In as the element, and show “**Step 1 (Check User Logged-in) logged\_in is no"**&#x20;

Let's navigate to the Home page when Login is clicked&#x20;

* Go to Workflow and add another event > Element > an element is clicked.&#x20;
* Select the Login Button as the element.&#x20;
* We need to redirect the user back to the home page. So, let's add an action > Navigation > Go to page, set  "index" as the destination page.

:thumbsup:<mark style="color:blue;">**Congratulations.....You are all set.**</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.secuuth.io/no-codes/bubble.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
