Пример #1
0
        protected virtual async Task <AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
        {
            var notification = new OAuthAuthenticatedContext(Context, Options, Backchannel, tokens)
            {
                Principal  = new ClaimsPrincipal(identity),
                Properties = properties
            };

            await Options.Notifications.Authenticated(notification);

            if (notification.Principal?.Identity == null)
            {
                return(null);
            }

            return(new AuthenticationTicket(notification.Principal, notification.Properties, Options.AuthenticationScheme));
        }
Пример #2
0
 /// <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="ClaimsIdentity"/>.</param>
 /// <returns>A <see cref="Task"/> representing the completed operation.</returns>
 public virtual Task Authenticated(OAuthAuthenticatedContext context) => OnAuthenticated(context);