---
title: SSO Email Already Exists
slug: bubble/sso-email-already-exists
docTags: 
createdAt: 2021-07-28T14:11:14.000Z
---

Many apps have the ability to let users log in using multiple methods - SSO/Identity **and&#x20;**&#x45;mail+Password &#x20;

If the user's email already exists using the Email+Password method, the SSO process will not log the user in and your users may be routed back to the sign in page.&#x20;

We recommend setting up a simple error message to handle such scenarios that also helps remind your users to check the method they used to log in.&#x20;



## Setup

After you have setup your SSO workflows according to the documentation the relevant setup documentation ( [Visual Element Based (SSO Plugin)](docId\:KWfzwSueRDIhAFf_1zhdF) OR [Plugin Action Based (SSO Plugin)](docId:-riJWaNr-pbv2idic6DCr) ), you will need to add the following steps:



### Add Message Text

Add a text element to your login page with the message you would like to show your user:



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/guVx3aN4FM9r_nUPAqIa4_image.png" size="76" width="1191" height="430" caption="Image: Text element with error" position="center" showCaption="true"}





### Add Custom Field

Add a custom field in your Bubble user data to capture the provider info, in this example, we are naming the custom field as **sign in method**. We will store the provider name in this field.



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/0gXu_TJKMti--xWL-zB6i_image.png" size="82" width="1678" height="672" caption="Image: Add custom field" position="center" showCaption="true"}



### Modify Workflow

- Step 1: In your existing SSO Login workflow, edit the first step to save the SSO Profile's Provider name against the user in your database:



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/vjxAnGQWZP4SuYJffevj__image.png" size="76" width="1305" height="982" caption="Image: Save provider name" position="center" showCaption="true"}



- Step 2: Add a condition to **Search for users\:count is 1** based on **email** and **sign in method**. This will search for the condition to see if the user has logged in via SSO or Email+Password method



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/ggQ79L9byZ1xnug0qa0tZ_image.png" size="96" width="1840" height="1015" caption="Image: Search for SSO user" position="center" showCaption="true"}



- Step 3: Add a Step 3 to the workflow to **Show** the Text element only when users email and sign in method match



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/z51SdFVnxxBNWAxC_RlUe_image.png" size="84" width="1575" height="1106" caption="Image: Show error" position="center" showCaption="true"}



This would show the message to the user to recheck their login method.





Need additional help? Reach out to our support via support\@pathfix.com or live chat through your Pathfix dashboard

