From 47866ac5db0f3c6fa26cf8cc6dfca732f09e1f9a Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 16 Sep 2015 17:21:01 -0700 Subject: [PATCH] React to renames from Auth --- .../OpenIdConnect/TestOpenIdConnectEvents.cs | 19 +++++++++---------- .../Mocks/StartupOpenIdConnectTesting.cs | 6 +++--- test/E2ETests/project.json | 17 +++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/TestOpenIdConnectEvents.cs b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/TestOpenIdConnectEvents.cs index bfc9bb9314..13a0cf4f0e 100644 --- a/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/TestOpenIdConnectEvents.cs +++ b/test/E2ETests/compiler/shared/Mocks/OpenIdConnect/TestOpenIdConnectEvents.cs @@ -20,19 +20,19 @@ namespace MusicStore.Mocks.OpenIdConnect return Task.FromResult(0); } - internal static Task SecurityTokenReceived(SecurityTokenReceivedContext context) + internal static Task AuthenticationValidated(AuthenticationValidatedContext context) { - eventsFired.Add(nameof(SecurityTokenReceived)); + eventsFired.Add(nameof(AuthenticationValidated)); return Task.FromResult(0); } - internal static Task SecurityTokenValidated(SecurityTokenValidatedContext context) + internal static Task AuthorizationResponseRecieved(AuthorizationResponseReceivedContext context) { Helpers.ThrowIfConditionFailed(() => context.AuthenticationTicket != null, "context.AuthenticationTicket is null."); Helpers.ThrowIfConditionFailed(() => context.AuthenticationTicket.Principal != null, "context.AuthenticationTicket.Principal is null."); Helpers.ThrowIfConditionFailed(() => context.AuthenticationTicket.Principal.Identity != null, "context.AuthenticationTicket.Principal.Identity is null."); Helpers.ThrowIfConditionFailed(() => !string.IsNullOrWhiteSpace(context.AuthenticationTicket.Principal.Identity.Name), "context.AuthenticationTicket.Principal.Identity.Name is null."); - eventsFired.Add(nameof(SecurityTokenValidated)); + eventsFired.Add(nameof(AuthorizationResponseRecieved)); return Task.FromResult(0); } @@ -43,10 +43,10 @@ namespace MusicStore.Mocks.OpenIdConnect eventsFired.Add(nameof(AuthorizationCodeReceived)); // Verify all events are fired. - if (eventsFired.Contains(nameof(RedirectToIdentityProvider)) && + if (eventsFired.Contains(nameof(RedirectToAuthenticationEndpoint)) && eventsFired.Contains(nameof(MessageReceived)) && - eventsFired.Contains(nameof(SecurityTokenReceived)) && - eventsFired.Contains(nameof(SecurityTokenValidated)) && + eventsFired.Contains(nameof(AuthenticationValidated)) && + eventsFired.Contains(nameof(AuthorizationResponseRecieved)) && eventsFired.Contains(nameof(AuthorizationCodeReceived))) { ((ClaimsIdentity)context.AuthenticationTicket.Principal.Identity).AddClaim(new Claim("ManageStore", "Allowed")); @@ -55,10 +55,9 @@ namespace MusicStore.Mocks.OpenIdConnect return Task.FromResult(0); } - internal static Task RedirectToIdentityProvider - (RedirectToIdentityProviderContext context) + internal static Task RedirectToAuthenticationEndpoint(RedirectContext context) { - eventsFired.Add(nameof(RedirectToIdentityProvider)); + eventsFired.Add(nameof(RedirectToAuthenticationEndpoint)); if (context.ProtocolMessage.RequestType == OpenIdConnectRequestType.LogoutRequest) { diff --git a/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs b/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs index f26123c2fd..9a2592596a 100644 --- a/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs +++ b/test/E2ETests/compiler/shared/Mocks/StartupOpenIdConnectTesting.cs @@ -81,9 +81,9 @@ namespace MusicStore { OnMessageReceived = TestOpenIdConnectEvents.MessageReceived, OnAuthorizationCodeReceived = TestOpenIdConnectEvents.AuthorizationCodeReceived, - OnRedirectToIdentityProvider = TestOpenIdConnectEvents.RedirectToIdentityProvider, - OnSecurityTokenReceived = TestOpenIdConnectEvents.SecurityTokenReceived, - OnSecurityTokenValidated = TestOpenIdConnectEvents.SecurityTokenValidated + OnRedirectToAuthenticationEndpoint = TestOpenIdConnectEvents.RedirectToAuthenticationEndpoint, + OnAuthenticationValidated = TestOpenIdConnectEvents.AuthenticationValidated, + OnAuthorizationResponseReceived = TestOpenIdConnectEvents.AuthorizationResponseRecieved }; }); diff --git a/test/E2ETests/project.json b/test/E2ETests/project.json index 32ed536a96..be1c14b4e9 100644 --- a/test/E2ETests/project.json +++ b/test/E2ETests/project.json @@ -5,14 +5,15 @@ "commands": { "test": "xunit.runner.aspnet" }, - "dependencies": { - "Microsoft.AspNet.Server.IIS": "1.0.0-*", - "Microsoft.AspNet.Server.Testing": "1.0.0-*", - "Microsoft.AspNet.WebUtilities": "1.0.0-*", - "Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-*", - "Microsoft.Framework.Logging.Console": "1.0.0-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, + "dependencies": { + "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*", + "Microsoft.AspNet.Server.IIS": "1.0.0-*", + "Microsoft.AspNet.Server.Testing": "1.0.0-*", + "Microsoft.AspNet.WebUtilities": "1.0.0-*", + "Microsoft.Framework.Configuration.EnvironmentVariables": "1.0.0-*", + "Microsoft.Framework.Logging.Console": "1.0.0-*", + "xunit.runner.aspnet": "2.0.0-aspnet-*" + }, "frameworks": { "dnx451": { "frameworkAssemblies": {