I've created a two-factor page for sitecore login on older sitecore (9.0 and below) by playing with its LoggedInArgs like this:
- Check the condition if 2FA needed. If it is, then abort LoggedInArgs
loggedInArgs.AbortPipeline();
loggedInArgs.AbortPipeline();
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);
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