What methods can be used by CSS or JavaScript to respond to the various stages of the Azure B2C Email Verification process?

Our Azure B2C custom policy includes email verification during sign-up to combat spam accounts.

The default email verification process in B2C can be cumbersome as it requires users to complete multiple steps on the same form:

  1. Enter email.
  2. Send verification code.
  3. Enter verification code, resend the code, or change email address.
  4. Click button to verify code.
  5. Complete remaining sign-up fields.
  6. Click button to finish sign-up.

This all happens in ONE FORM, which can overwhelm regular consumers.

To improve the user experience, we have implemented the split email verification and sign-up user journey from the CIAM sample journeys project. While this has helped, there are still issues such as lack of guidance on each screen, disappearing and reappearing user controls, and confusion around button labels like "Continue" and "Cancel". We aim to simplify the process further and create a smoother UI.

One key improvement we need is the ability to customize CSS styling based on the user's current stage in the process. For instance, hiding the "Continue" button when the user is entering their email or verification code, and overriding B2C's default behavior of hiding controls during AJAX requests. Unfortunately, it seems that B2C's JavaScript system restricts access to these elements, making it difficult for us to identify the step the widget is at.

Is there a way to integrate with B2C's JavaScript to better understand its logic? Our goal is to set a "mode" data attribute on our page for reference in our stylesheets.

Answer №1

In order to achieve this task, we utilized jQuery to monitor the XHR requests being sent by B2C and then linked them with their responses to identify the mode we are currently in. While there is a risk that Microsoft may alter the API functionality and disrupt our implementation, this approach has proven to be more dependable compared to other methods.

Prior to adopting this strategy, we attempted to identify CSS classes added by B2C to fields with invalid values and relied on the visibility of UI controls to determine the mode. However, these approaches were quite delicate. Our code either executed before Azure's, resulting in outdated page classes, or failed to address all the necessary error scenarios such as invalid email addresses or exceeding login attempts.

Our method involves incorporating JavaScript and CSS within the custom HTML template for the flow. Additionally, we have ensured to enable JavaScript in the User Journey.

The following is an example of the code we are using:

(JavaScript code here)

Furthermore, our CSS code appears as follows:

(CSS code here)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Disable the "top" property for the Material UI Drawer component

I'm currently working on implementing a Persist Left Drawer from Material UI that slides in from the left side. However, I don't want the drawer to cover the entire left side of the page. Essentially, I want to remove the "top" style property men ...

Building custom directives in Angular.js with d3.js

Working with an angular.js directive and d3 integration can sometimes be tricky, but thanks to resources like stackoverflow it's definitely achievable. However, I'm currently facing issues with getting the arrows to display properly in my project ...

Is there a way to seamlessly integrate typeahead.js with jquery.validate?

Currently, I have a website built on ASP.NET MVC 5 which utilizes jQuery validation (specifically 'jquery.validate.js' in the MVC project template). My goal is to implement type-ahead functionality using 'typeahead.js' on an input field ...

AngularJs triggers a function once two distinct https requests have been completed

If I have two HTTP requests that I need to be called asynchronously, but both must be completed before rendering my view, how can I ensure that these two separate calls are done in order to trigger a specific function? Calls 3 and 4 can continue running in ...

Searching for an element using Python's Selenium and JavaScript

on this page I am trying to click on the "Choose file" button but I keep getting the error message: javascript error: argument is not defined var1 = sys.argv[1] path = os.path.abspath(var1) driver.get("https://www.virustotal.com/gui/home/upload& ...

Having trouble with the "next" pagination button not loading cards, even though the numbered buttons are working perfectly

My pagination numbers are functioning correctly, but I'm having trouble with my "next" or "previous" buttons. I am using Bootstrap 5 and jQuery to load cards from an array. The issue seems to be with the currentPage variable in my displayList function ...

The amazing property of AngularJS - Scope

I have saved this HTML code in a file. Here is the HTML : <!-- checkbox 1 --> <input type="checkbox" name="checkbox1" id="checkbox-group1" ng-model="checkbox1" value="group1"> <input type="checkbox" name="checkbox1" id="checkbox-group2" ng ...

What is the best approach for Angular directives: utilizing a single object or separate values as attributes?

This question pertains to best practices, but I do believe there is a definitive answer. I have a directive that offers six customizable options. Should I assign each option to a separate attribute on the directive (as shown below): <my-directive my ...

Conceal the item and reveal it upon clicking

There are three div boxes included in a rotator script. However, when clicking on the right button, all three boxes appear overlapping each other instead of showing one at a time. How can I make it so that only one box is shown and the others appear upon c ...

Error occurs when attempting to filter data through input text pasting in Angular

Currently, I am working on a web application that utilizes the Angular framework and angularfire2. The issue I am encountering is related to the data filter functionality not functioning correctly when pasting copied text. Interestingly, it works perfectly ...

Click on an image to select four numbers using JavaScript

I have a selection of images representing numbers 1 through 9. When a user clicks on one of these images, I want to save the corresponding number (e.g., if they click on the image with the number 1, I want to save the number 1). However, I only require fou ...

Creating a unique texture for a custom geometry mesh using Three.js

I'm currently working on constructing a house geometry and applying various textures to the faces of the geometry. The framework I'm using is r55. However, I'm facing an issue where faces with materials generated from textures are not appear ...

Save a PHP variable following a JavaScript (or any other language) redirection

I am attempting to accomplish the following task: A parent element (referred to as A) should be the only means of accessing an iframe within another application (known as B) on the same domain. It is important that direct access to B is restricted, with a ...

Deciphering the LocalDate and nested object array in an AJAX response

Seeking assistance, looking for solutions to two problems. Firstly, how can I display LocalDate in an ajax response? And secondly, how do I iterate over a list of Custom objects received in the ajax response? I am passing a List of Custom Objects and Loca ...

Route all Express JS paths to a static maintenance page

Need help with setting up a static Under construction page for an Angular Web App with Express Node JS Backend. I have a function called initStaticPages that initializes all routes and have added a new Page served via /maintenance. However, when trying to ...

What could be causing the issue with my connection.query when using mysql in node.js?

Purpose: The goal is to perform a basic query on the database. Expected Outcome: The console should display "please print something!" along with the results of the query. Actual Outcome: Sadly, nothing appears on the terminal screen. Issues: No error me ...

Deciphering a Base64 image string in order to convert it back into a file for uploading to Parse

Incorporating CropperJS into a Node.js solution poses a challenge for me as I aim to convert the returned Base64 string into a file format in order to upload it. The goal is to maintain functionality while utilizing the file type as a parameter. Despite m ...

CSS - Positioning a rectangle between two squares

I need help creating a layout with 2 rows of 4 squares, each with a rectangle in the middle of two squares. https://i.sstatic.net/9pWBi.png This is the code I currently have: .main { width: 100%; height: auto; } .square { width: 25%; position: ...

AngularJS, sort through "afoo" excluding "foo"

I am attempting to implement a filter within an ng-repeat Main.HTML <table> <tr ng-repeat="param in MyParam | filter: UnrequestValue"> <td>{{param.Label}}</td> </tr> </table> Main.js MyParam: ...

"Transferring an array of data to a Laravel controller via AJAX: A step-by-step guide

Is there a way to send arrays of data to the back-end all at once? The Problem 1. This is what I'm currently sending: array:5 [ "_token" => "S5s5ZTTnnP93MyXgCql0l9vhHsiqt5VWaFyEedXj" "product_id" => "21" "specification_id" => "6" " ...