Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Adam 5 posts 105 karma points
    Feb 28, 2023 @ 10:26
    Adam
    0

    How to override the view for Users 2fa login-2fa.html, should I do this in angular or in c#?

    I'm trying to work out how I should modify the two factor view provided to users that have 2fa enabled.

    I can see that a post request is made to /umbraco/backoffice/umbracoapi/authentication/PostLogin with the response containing:

    )]}',
    {"twoFactorView":"views\\common\\login-2fa.html","userId":9}
    

    I would like to change this view to remove the need for a user to enter a code. Since I'm using DUO as the 2fa provider, a code is not required, just an action in the app to confirm access.

    Please could someone explain if I should modify umbraco or angular to achieve this.

    I've created a stack post summarising my question.

    https://stackoverflow.com/questions/75584506/umbraco-10-how-to-set-the-view-for-2fa-angular-or-in-c

  • Marc Goodson 2157 posts 14435 karma points MVP 10x c-trib
    Mar 01, 2023 @ 21:54
    Marc Goodson
    100

    Hi Adam

    Have a look at this search of the core git repo for IBackOfficeTwoFactorOptions

    https://github.com/umbraco/Umbraco-CMS/search?q=IBackOfficeTwoFactorOptions&type=

    It shows the DefaultBackOfficeTwoFactorOptions implementation that sets the path to that two-factor view

    And shows how that class is registered as a singleton

    This means you can implement your own version of IBackOfficeTwoFactorOptions to set this view to be something else, and if in a composition or at startup you register your implementation of the interface as a Singleton, it will push out the core default one and use yours instead.

    Possibly the search reveals an existing alternate implementation called NoopBackOfficeTwoFactor that might be what you...

    Regards

    Marc

  • Adam 5 posts 105 karma points
    Mar 03, 2023 @ 11:23
    Adam
    0

    Many thanks for your reply Marc. Have resolved this with the detail provided.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies