Copied to clipboard

Flag this post as spam?

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


  • L P 13 posts 123 karma points
    Jul 19, 2018 @ 12:02
    L P
    0

    owin startup and 2FA

    After upgrading Umbraco CMS from 7.5.4 to 7.11.1 version I have a problem with the login, it keeps logout me every 1 min! Digging in the forums, common questions and the code I've got, I updated the owin:startup setting from FortressOwinStartup to UmbracoDefaultOwinStartup! This update was due to the Umbraco2FA package which depends on Fortress!

    After returning to UmbracoDefaultOwinStartup the problem was solved, but now the Umbraco2FA is not working! The setup is working ok, but when logout and then login it is not showing the 2FA login form!

    Is there a way to make the 2FA work UmbracoDefaultOwinStartup?

  • t w 4 posts 75 karma points
    Aug 07, 2018 @ 14:51
    t w
    0

    I am getting this behaviour as well Everything else seems to be working fine but I'm getting logged out after a minute or so

  • L P 13 posts 123 karma points
    Aug 08, 2018 @ 10:16
    L P
    0

    I have fixed this by creating a new owin startup class, which inherits UmbracoDefaultOwinStartup! I got the Fortress source code and extended it by configuring the following cookies:

    • UseUmbracoBackOfficeCookieAuthentication
    • UseUmbracoBackOfficeExternalCookieAuthentication
    • UseOAuthAuthorizationServer UseCookieAuthentication
    • UseUmbracoPreviewAuthentication UseTwoFactorSignInCookie

    Now everything works fine!

  • t w 4 posts 75 karma points
    Aug 08, 2018 @ 16:13
    t w
    0

    that sounds good!

    ive tried to do the same by getting the Orc.Fortress source and modifying the FortressOwinStartup which inherits from UmbracoDefaultOwinStartup

    i tried copying what the default class is doing when setting these cookies

    but i havent been able to fix the issue, at least whilst still keeping the 2FA functionality

    ...if possible, could you post the source code you wrote?

  • t w 4 posts 75 karma points
    Aug 09, 2018 @ 09:54
    t w
    2

    ah, have fixed it, all we did was to ensure that the overridden method ConfigureServices calls the base method first

    so in https://github.com/Offroadcode/Umbraco-2FA/blob/master/Umbraco2FA/Umbraco/Fortress/Startup/FortressOwinStartup.cs, from line 34 onwards it looks like:

     protected override void ConfigureServices(IAppBuilder app)
        {
            base.ConfigureServices(app);
            app.SetUmbracoLoggerFactory();
            ...
    

    that way, presumably, all of the cookies are set as they were originally

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Oct 19, 2018 @ 13:07
    Peter Duncanson
    2

    Thanks for discussing and reporting back on the fix for this one folks. I've logged this in our repos here https://github.com/Offroadcode/Umbraco-2FA/issues/12

  • Nick Hoang 51 posts 180 karma points c-trib
    Nov 12, 2018 @ 14:10
    Nick Hoang
    0

    I agree that we shouldn't change owin startup setting, I've made an update allow to call the owin setup manually, check my pull-request for more details: https://github.com/Offroadcode/Umbraco-2FA/pull/15

    Cheers, Nick

Please Sign in or register to post replies

Write your reply to:

Draft