Beispiel #1
0
        protected virtual async Task <AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, AccessToken token)
        {
            var context = new DeveloperAuthCreatingTicketContext(Context, Options, token.UserId, token.ScreenName, token.Token, token.TokenSecret)
            {
                Principal  = new ClaimsPrincipal(identity),
                Properties = properties
            };

            await Options.Events.CreatingTicket(context);

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

            return(new AuthenticationTicket(context.Principal, context.Properties, Options.AuthenticationScheme));
        }
Beispiel #2
0
 /// <summary>
 /// Invoked whenever DeveloperAuth 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(DeveloperAuthCreatingTicketContext context) => OnCreatingTicket(context);
 /// <summary>
 /// Invoked whenever DeveloperAuth 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(DeveloperAuthCreatingTicketContext context) => OnCreatingTicket(context);