Skip to main content
edited tags
Link
purnadika
  • 367
  • 2
  • 13
deleted 107 characters in body; edited tags
Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79

I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:

  1. Check the condition if 2FA needed. If it is, then abort LoggedInArgs

loggedInArgs.AbortPipeline();

loggedInArgs.AbortPipeline();

  1. On 2FA page the user will enter their code then proceed to login by creating new LoggedInArgs using username and starturl gathered by first step

    LoggedInArgs loggedInArgs = new LoggedInArgs()
                            {
                                Username = userName,
                                StartUrl = startUrl
                            };
    Pipeline.Start("loggedin", loggedInArgs);
    
    LoggedInArgs loggedInArgs = new LoggedInArgs()
    {
        Username = userName,
        StartUrl = startUrl
    };
    Pipeline.Start("loggedin", loggedInArgs);
    
  2. Then Sitecore will login accordingly

But on Sitecore 9.1 we are using IdentityServerIdentityServer and using new args which is SignedInArgsSignedInArgs. I can't create the argsargs manually since it needneeds CookieResponseSignedInContextCookieResponseSignedInContext from (I guess) OwinOwin on IdentityServerIdentityServer.

LoggedInArgsLoggedInArgs is deprecated but still usable until Sitecore 9.2 which will delete all deprecated codes.

Is there any way to do it? or some workarounds? Thanks

I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:

  1. Check the condition if 2FA needed. If it is, then abort LoggedInArgs

loggedInArgs.AbortPipeline();

  1. On 2FA page the user will enter their code then proceed to login by creating new LoggedInArgs using username and starturl gathered by first step

    LoggedInArgs loggedInArgs = new LoggedInArgs()
                            {
                                Username = userName,
                                StartUrl = startUrl
                            };
    Pipeline.Start("loggedin", loggedInArgs);
    
  2. Then Sitecore will login accordingly

But on Sitecore 9.1 we are using IdentityServer and using new args which is SignedInArgs. I can't create the args manually since it need CookieResponseSignedInContext from (I guess) Owin on IdentityServer.

LoggedInArgs is deprecated but still usable until Sitecore 9.2 which will delete all deprecated codes.

Is there any way to do it? or some workarounds? Thanks

I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:

  1. Check the condition if 2FA needed. If it is, then abort LoggedInArgs

loggedInArgs.AbortPipeline();

  1. On 2FA page the user will enter their code then proceed to login by creating new LoggedInArgs using username and starturl gathered by first step

    LoggedInArgs loggedInArgs = new LoggedInArgs()
    {
        Username = userName,
        StartUrl = startUrl
    };
    Pipeline.Start("loggedin", loggedInArgs);
    
  2. Then Sitecore will login accordingly

But on Sitecore 9.1 we are using IdentityServer and using new args which is SignedInArgs. I can't create the args manually since it needs CookieResponseSignedInContext from (I guess) Owin on IdentityServer.

LoggedInArgs is deprecated but still usable until Sitecore 9.2 which will delete all deprecated codes.

Is there any way to do it? or some workarounds?

Source Link
purnadika
  • 367
  • 2
  • 13

How to pause SignedInArgs, move to a page, then continue OR create a new SignedInArgs to complete the login?

I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:

  1. Check the condition if 2FA needed. If it is, then abort LoggedInArgs

loggedInArgs.AbortPipeline();

  1. On 2FA page the user will enter their code then proceed to login by creating new LoggedInArgs using username and starturl gathered by first step

    LoggedInArgs loggedInArgs = new LoggedInArgs()
                            {
                                Username = userName,
                                StartUrl = startUrl
                            };
    Pipeline.Start("loggedin", loggedInArgs);
    
  2. Then Sitecore will login accordingly

But on Sitecore 9.1 we are using IdentityServer and using new args which is SignedInArgs. I can't create the args manually since it need CookieResponseSignedInContext from (I guess) Owin on IdentityServer.

LoggedInArgs is deprecated but still usable until Sitecore 9.2 which will delete all deprecated codes.

Is there any way to do it? or some workarounds? Thanks