React to identity changes

This commit is contained in:
Hao Kung 2017-05-22 13:52:59 -07:00
parent ddd69e5fdf
commit 6c13465dc2
8 changed files with 8 additions and 4 deletions

View File

@ -32,7 +32,7 @@ namespace MusicStore.Mocks.Facebook
internal static Task OnTicketReceived(TicketReceivedContext context)
{
if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
if (context.Principal != null && context.Options.SignInScheme == IdentityConstants.ExternalScheme)
{
//This way we will know all events were fired.
var identity = context.Principal.Identities.First();

View File

@ -32,7 +32,7 @@ namespace MusicStore.Mocks.Google
internal static Task OnTicketReceived(TicketReceivedContext context)
{
if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
if (context.Principal != null && context.Options.SignInScheme == IdentityConstants.ExternalScheme)
{
//This way we will know all events were fired.
var identity = context.Principal.Identities.First();

View File

@ -33,7 +33,7 @@ namespace MusicStore.Mocks.MicrosoftAccount
internal static Task OnTicketReceived(TicketReceivedContext context)
{
if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
if (context.Principal != null && context.Options.SignInScheme == IdentityConstants.ExternalScheme)
{
//This way we will know all events were fired.
var identity = context.Principal.Identities.First();

View File

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;

View File

@ -26,7 +26,7 @@ namespace MusicStore.Mocks.Twitter
internal static Task OnTicketReceived(TicketReceivedContext context)
{
if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
if (context.Principal != null && context.Options.SignInScheme == IdentityConstants.ExternalScheme)
{
//This way we will know all Events were fired.
var identity = context.Principal.Identities.First();

View File

@ -1,3 +1,4 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

View File

@ -3,6 +3,7 @@ using System.Security.Claims;
using System.Security.Principal;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;

View File

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;