React to Authentication API changes.

This commit is contained in:
Chris R 2015-10-15 09:24:14 -07:00
parent 67692e1c89
commit dbe4327932
5 changed files with 12 additions and 12 deletions

View File

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

View File

@ -31,9 +31,9 @@ namespace MusicStore.Mocks.Google
return Task.FromResult(0); return Task.FromResult(0);
} }
internal static Task OnSigningIn(SigningInContext context) internal static Task OnTicketReceived(TicketReceivedContext context)
{ {
if (context.Principal != null && context.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme) if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
{ {
//This way we will know all events were fired. //This way we will know all events were fired.
var identity = context.Principal.Identities.First(); var identity = context.Principal.Identities.First();

View File

@ -32,9 +32,9 @@ namespace MusicStore.Mocks.MicrosoftAccount
return Task.FromResult(0); return Task.FromResult(0);
} }
internal static Task OnSigningIn(SigningInContext context) internal static Task OnTicketReceived(TicketReceivedContext context)
{ {
if (context.Principal != null && context.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme) if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
{ {
//This way we will know all events were fired. //This way we will know all events were fired.
var identity = context.Principal.Identities.First(); var identity = context.Principal.Identities.First();

View File

@ -137,7 +137,7 @@ namespace MusicStore
options.Events = new OAuthEvents() options.Events = new OAuthEvents()
{ {
OnCreatingTicket = TestFacebookEvents.OnCreatingTicket, OnCreatingTicket = TestFacebookEvents.OnCreatingTicket,
OnSigningIn = TestFacebookEvents.OnSigningIn, OnTicketReceived = TestFacebookEvents.OnTicketReceived,
OnRedirectToAuthorizationEndpoint = TestFacebookEvents.RedirectToAuthorizationEndpoint OnRedirectToAuthorizationEndpoint = TestFacebookEvents.RedirectToAuthorizationEndpoint
}; };
options.BackchannelHttpHandler = new FacebookMockBackChannelHttpHandler(); options.BackchannelHttpHandler = new FacebookMockBackChannelHttpHandler();
@ -155,7 +155,7 @@ namespace MusicStore
options.Events = new OAuthEvents() options.Events = new OAuthEvents()
{ {
OnCreatingTicket = TestGoogleEvents.OnCreatingTicket, OnCreatingTicket = TestGoogleEvents.OnCreatingTicket,
OnSigningIn = TestGoogleEvents.OnSigningIn, OnTicketReceived = TestGoogleEvents.OnTicketReceived,
OnRedirectToAuthorizationEndpoint = TestGoogleEvents.RedirectToAuthorizationEndpoint OnRedirectToAuthorizationEndpoint = TestGoogleEvents.RedirectToAuthorizationEndpoint
}; };
options.StateDataFormat = new CustomStateDataFormat(); options.StateDataFormat = new CustomStateDataFormat();
@ -169,7 +169,7 @@ namespace MusicStore
options.Events = new TwitterEvents() options.Events = new TwitterEvents()
{ {
OnCreatingTicket = TestTwitterEvents.OnCreatingTicket, OnCreatingTicket = TestTwitterEvents.OnCreatingTicket,
OnSigningIn = TestTwitterEvents.OnSigningIn, OnTicketReceived = TestTwitterEvents.OnTicketReceived,
OnRedirectToAuthorizationEndpoint = TestTwitterEvents.RedirectToAuthorizationEndpoint OnRedirectToAuthorizationEndpoint = TestTwitterEvents.RedirectToAuthorizationEndpoint
}; };
options.StateDataFormat = new CustomTwitterStateDataFormat(); options.StateDataFormat = new CustomTwitterStateDataFormat();
@ -184,7 +184,7 @@ namespace MusicStore
options.Events = new OAuthEvents() options.Events = new OAuthEvents()
{ {
OnCreatingTicket = TestMicrosoftAccountEvents.OnCreatingTicket, OnCreatingTicket = TestMicrosoftAccountEvents.OnCreatingTicket,
OnSigningIn = TestMicrosoftAccountEvents.OnSigningIn, OnTicketReceived = TestMicrosoftAccountEvents.OnTicketReceived,
OnRedirectToAuthorizationEndpoint = TestMicrosoftAccountEvents.RedirectToAuthorizationEndpoint OnRedirectToAuthorizationEndpoint = TestMicrosoftAccountEvents.RedirectToAuthorizationEndpoint
}; };
options.BackchannelHttpHandler = new MicrosoftAccountMockBackChannelHandler(); options.BackchannelHttpHandler = new MicrosoftAccountMockBackChannelHandler();

View File

@ -25,9 +25,9 @@ namespace MusicStore.Mocks.Twitter
return Task.FromResult(0); return Task.FromResult(0);
} }
internal static Task OnSigningIn(SigningInContext context) internal static Task OnTicketReceived(TicketReceivedContext context)
{ {
if (context.Principal != null && context.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme) if (context.Principal != null && context.Options.SignInScheme == new IdentityCookieOptions().ExternalCookieAuthenticationScheme)
{ {
//This way we will know all Events were fired. //This way we will know all Events were fired.
var identity = context.Principal.Identities.First(); var identity = context.Principal.Identities.First();