public static async Task SignInAsync(this AuthenticationManager manager, string sub, string name, string identityProvider, IEnumerable <string> authenticationMethods, AuthenticationProperties properties, params Claim[] claims) { var scheme = manager.GetIdentityServerAuthenticationScheme(); var principal = IdentityServerPrincipal.Create(sub, name, identityProvider, authenticationMethods, claims); await manager.SignInAsync(scheme, principal, properties); }
public static async Task SignInAsync(this AuthenticationManager manager, string subject, string name, string identityProvider, params Claim[] claims) { var scheme = manager.GetIdentityServerAuthenticationScheme(); var principal = IdentityServerPrincipal.Create(subject, name, identityProvider, claims); await manager.SignInAsync(scheme, principal); }
/// <summary> /// Signs the user in. /// </summary> /// <param name="manager">The manager.</param> /// <param name="subject">The subject.</param> /// <param name="name">The name.</param> /// <param name="identityProvider">The identity provider.</param> /// <param name="properties">The properties.</param> /// <param name="claims">The claims.</param> /// <returns></returns> public static async Task SignInAsync(this AuthenticationManager manager, string subject, string name, string identityProvider, AuthenticationProperties properties, params Claim[] claims) { var scheme = manager.GetIdentityServerAuthenticationScheme(); var options = manager.HttpContext.RequestServices.GetRequiredService <IdentityServerOptions>(); var principal = IdentityServerPrincipal.Create(subject, name, identityProvider, options.UtcNow, claims); await manager.SignInAsync(scheme, principal, properties); }
/// <summary> /// Signs the user in. /// </summary> /// <param name="manager">The manager.</param> /// <param name="subject">The subject.</param> /// <param name="name">The name.</param> /// <param name="authenticationMethods">The authentication methods.</param> /// <param name="claims">The claims.</param> /// <returns></returns> public static async Task SignInAsync(this AuthenticationManager manager, string subject, string name, IEnumerable <string> authenticationMethods, params Claim[] claims) { var scheme = manager.GetIdentityServerAuthenticationScheme(); var options = manager.HttpContext.RequestServices.GetRequiredService <IdentityServerOptions>(); var principal = IdentityServerPrincipal.Create(subject, name, authenticationMethods, options.UtcNow, claims); await manager.SignInAsync(scheme, principal); }
public static async Task SignOutAsync(this AuthenticationManager manager) { var scheme = manager.GetIdentityServerAuthenticationScheme(); await manager.SignOutAsync(scheme); }