private async Task <bool> InvokeReplyPathAsync() { if (!Options.CallbackPath.HasValue || !(Options.CallbackPath == Request.Path)) { return(false); } var ticket = await AuthenticateAsync(); if (ticket == null) { _logger.WriteWarning("Invalid return state, unable to redirect."); Response.StatusCode = 500; return(true); } var context = new FacebookReturnEndpointContext(Context, ticket) { SignInAsAuthenticationType = Options.SignInAsAuthenticationType, RedirectUri = ticket.Properties.RedirectUri }; await Options.Provider.ReturnEndpoint(context); if (context.SignInAsAuthenticationType != null && context.Identity != null) { var claimsIdentity = context.Identity; if (!string.Equals(claimsIdentity.AuthenticationType, context.SignInAsAuthenticationType, StringComparison.Ordinal)) { claimsIdentity = new ClaimsIdentity(claimsIdentity.Claims, context.SignInAsAuthenticationType, claimsIdentity.NameClaimType, claimsIdentity.RoleClaimType); } Context.Authentication.SignIn(context.Properties, claimsIdentity); } if (context.IsRequestCompleted || context.RedirectUri == null) { return(context.IsRequestCompleted); } var str = context.RedirectUri; if (context.Identity == null) { str = WebUtilities.AddQueryString(str, "error", "access_denied"); } Response.Redirect(str); context.RequestCompleted(); return(context.IsRequestCompleted); }
public override Task ReturnEndpoint(FacebookReturnEndpointContext context) { return(base.ReturnEndpoint(context)); }
public Task ReturnEndpoint(FacebookReturnEndpointContext context) { return(Task.FromResult <object>(null)); }