2 deleted 316 characters in body
source | link

Since our code use Persist checking (LoggedInArgs.Persist (bool)), I'm not sure where is this persist checking located within SignedInArgs. I just commented out those lines for now. Maybe anyone here can relate and explain whatAs Sitecore Sitecore saidsaid with missing Persist property?

SignedInArgs

public class SignedInArgs : PipelineArgs
    {
        public SignedInArgs(Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext context);
        public Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext Context { get; }
        public ApplicationUser User { get; set; }
        public SiteContext Site { get; set; }
        public string StartUrl { get; set; }
        public AuthenticationSource AuthenticationSource { get; set; }
    }

LoggedInArgs

public class LoggedInArgs : PipelineArgs
{
    public LoggedInArgs();
    protected LoggedInArgs(SerializationInfo info, StreamingContext context);
    public bool Persist { get; set; }
    public string Username { get; set; }
    public string StartUrl { get; set; }
    public HttpContextBase Context { get; }
    public override void GetObjectData(SerializationInfo info, StreamingContext context);  }

Web applications create persistent authentication cookies when a user selects a Remember me option. Authentication through Federated Authentication produces only non-persistent cookies.

For example, if you sign in through an external identity provider without selecting the Remember me option on that provider, then you have to sign in again after the browser session expires.

If you sign in through an external identity provider and you select the Remember me option on that provider, then you will lose your Sitecore authentication cookie when the browser session expires. However, after a quick auto-redirect to the identity provider and back, you are automatically signed-in to Sitecore again.

Since our code use Persist checking (LoggedInArgs.Persist (bool)), I'm not sure where is this persist checking located within SignedInArgs. I just commented out those lines for now. Maybe anyone here can relate and explain what Sitecore said with missing Persist property?

SignedInArgs

public class SignedInArgs : PipelineArgs
    {
        public SignedInArgs(Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext context);
        public Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext Context { get; }
        public ApplicationUser User { get; set; }
        public SiteContext Site { get; set; }
        public string StartUrl { get; set; }
        public AuthenticationSource AuthenticationSource { get; set; }
    }

LoggedInArgs

public class LoggedInArgs : PipelineArgs
{
    public LoggedInArgs();
    protected LoggedInArgs(SerializationInfo info, StreamingContext context);
    public bool Persist { get; set; }
    public string Username { get; set; }
    public string StartUrl { get; set; }
    public HttpContextBase Context { get; }
    public override void GetObjectData(SerializationInfo info, StreamingContext context);  }

Since our code use Persist checking (LoggedInArgs.Persist (bool)), I'm not sure where is this persist checking located within SignedInArgs. I just commented out those lines for now. As Sitecore said

Web applications create persistent authentication cookies when a user selects a Remember me option. Authentication through Federated Authentication produces only non-persistent cookies.

For example, if you sign in through an external identity provider without selecting the Remember me option on that provider, then you have to sign in again after the browser session expires.

If you sign in through an external identity provider and you select the Remember me option on that provider, then you will lose your Sitecore authentication cookie when the browser session expires. However, after a quick auto-redirect to the identity provider and back, you are automatically signed-in to Sitecore again.

1
source | link

I've figured out the answer based on the comment from @Gobinath and answer of this thread.

So, first you must add NEW config for these Owin and IdentityServer stuffs and don't touch your previous version of these processes (before IdentityServer, in my case it's working properly without IS)

<configuration>
<sitecore>
<pipelines>

<owin.cookieAuthentication.signIn>
<processor resolve="true" type="your.SIGN-IN.pipeline, YourDLL" patch:after="processor[@type='Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignIn.UpdateUserProperties, Sitecore.Owin.Authentication']"/>
</owin.cookieAuthentication.signIn>

<owin.cookieAuthentication.signedIn>
<processor resolve="true" type=" your.SIGNED-IN.Pipeline, YourDll" patch:before="processor[@type='Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn.CreateTicket, Sitecore.Owin.Authentication']"/>
</owin.cookieAuthentication.signedIn>

</pipelines>
</sitecore>
</configuration>

You can adjust patch:after processor and add more processors for your needs.

Then, on your code you need to inherit SignInProcessor or SignedInProcessor then override Process with SignInArgs/SignedInArgs as parameter.

public class YourSignInProcessor : SignInProcessor
    {
        public override void Process(SignInArgs args)
        {
          add your code here
        }
    }
public class YourSignedInProcessor : SignedInProcessor
    {
        public override void Process(SignedInArgs args)
        {
          add your code here
        }
    }

Since our code use Persist checking (LoggedInArgs.Persist (bool)), I'm not sure where is this persist checking located within SignedInArgs. I just commented out those lines for now. Maybe anyone here can relate and explain what Sitecore said with missing Persist property?

SignedInArgs

public class SignedInArgs : PipelineArgs
    {
        public SignedInArgs(Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext context);
        public Microsoft.Owin.Security.Cookies.CookieResponseSignedInContext Context { get; }
        public ApplicationUser User { get; set; }
        public SiteContext Site { get; set; }
        public string StartUrl { get; set; }
        public AuthenticationSource AuthenticationSource { get; set; }
    }

LoggedInArgs

public class LoggedInArgs : PipelineArgs
{
    public LoggedInArgs();
    protected LoggedInArgs(SerializationInfo info, StreamingContext context);
    public bool Persist { get; set; }
    public string Username { get; set; }
    public string StartUrl { get; set; }
    public HttpContextBase Context { get; }
    public override void GetObjectData(SerializationInfo info, StreamingContext context);  }