AD B2C Custom Policy Passwordless redirect to authorized page

Felix Cordeta Matusinio 0 Reputation points
2024-05-06T13:03:46.9433333+00:00

Is there a custom policy sample that will automatically redirect the user to authorized page after clicking verify (email received code and was verified) button? I mean no need to add/display Continue button

How can I achieve this using custom policy?

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,244 questions
Microsoft Entra
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 29,756 Reputation points Microsoft Employee
    2024-05-09T06:27:50.2533333+00:00

    Hi @Felix Cordeta Matusinio ,

    Thanks for reaching out.

    Unfortunately, you cannot merge the Verify code and Continue buttons in one button using Custom Policy. You need to work with a front-end developer to use a custom HTML page for your signup/sign-in with JavaScript/CSS for this purpose.

    You may consider using JavaScript MutationObserver to detect that the Continue button has been enabled, then automate the clicks with javascript.

    $("#continue").hide();
    var observer = new MutationObserver(function (mutations) {
        mutations.forEach(function (mutationRecord) {
            $("#continue").show();
        });
    });
    var target = document.getElementById('email_success');
    observer.observe(target, { attributes: true, attributeFilter: ['style'] });
    
    
    

    Hope this will help.

    Thanks,

    Shweta

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments