示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        /// <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);
        }
示例#4
0
        /// <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);
        }
示例#5
0
 public static async Task SignOutAsync(this AuthenticationManager manager)
 {
     var scheme = manager.GetIdentityServerAuthenticationScheme();
     await manager.SignOutAsync(scheme);
 }