protected virtual async Task <AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, MiniProgramToken miniProgramToken, JsonElement user)
        {
            var context = new MiniProgramCreatingTicketContext(Context, Scheme, Options, new ClaimsPrincipal(identity), properties, miniProgramToken.openid, miniProgramToken.session_key, miniProgramToken.unionid, user);

            context.RunClaimActions();
            await Events.CreatingTicket(context);

            return(new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name));
        }
Exemplo n.º 2
0
        ///// <summary>
        ///// Gets or sets the delegate that is invoked when the RedirectToAuthorizationEndpoint method is invoked.
        ///// </summary>
        //public Func<RedirectContext<OAuthOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context =>
        //{
        //    context.Response.Redirect(context.RedirectUri);
        //    return Task.CompletedTask;
        //};

        /// <summary>
        /// Invoked after the provider successfully authenticates a user.
        /// </summary>
        /// <param name="context">Contains information about the login session as well as the user <see cref="System.Security.Claims.ClaimsIdentity"/>.</param>
        /// <returns>A <see cref="Task"/> representing the completed operation.</returns>
        public virtual Task CreatingTicket(MiniProgramCreatingTicketContext context) => OnCreatingTicket(context);