protected virtual async Task <AuthenticationTicket> CreateTicketAsync( [NotNull] ClaimsIdentity identity, [NotNull] AuthenticationProperties properties, [NotNull] string identifier, [NotNull] IDictionary <string, string> attributes) { var principal = new ClaimsPrincipal(identity); var ticket = new AuthenticationTicket(principal, properties, Options.AuthenticationScheme); var context = new OpenIdAuthenticatedContext(Context, Options, ticket); // Copy the attributes to the context object. foreach (var attribute in attributes) { context.Attributes.Add(attribute); } await Options.Events.Authenticated(context); // Note: return the authentication ticket associated // with the notification to allow replacing the ticket. return(context.Ticket); }
/// <summary> /// Defines a notification invoked when the user is authenticated by the identity provider. /// </summary> /// <param name="context">The context of the event carries information in and results out.</param> /// <returns>Task to enable asynchronous execution</returns> public virtual Task Authenticated(OpenIdAuthenticatedContext context) => OnAuthenticated(context);