From 6c9157ff51c441076aeb1cb7d25cf59eae14439b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 21 Sep 2015 16:47:33 -0700 Subject: [PATCH] Fix tests --- .../OpenIdConnect/OpenIdConnectHandlerTests.cs | 4 ++-- .../OpenIdConnectBearer/OpenIdConnectBearerMiddlewareTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs index c3b15e2160..1cb1cb5890 100644 --- a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnect/OpenIdConnectHandlerTests.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.IdentityModel.Tokens; -using System.IdentityModel.Tokens.OpenIdConnect; +using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Net.Http; using System.Security.Claims; @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Authentication.Tests.OpenIdConnect public class OpenIdConnectHandlerTests { private const string nonceForOpenIdConnect = "abc"; - private static SecurityToken specCompliantOpenIdConnect = new OpenIdConnectSecurityToken("issuer", "audience", new List { new Claim("iat", EpochTime.GetIntDate(DateTime.UtcNow).ToString()), new Claim("nonce", nonceForOpenIdConnect) }, DateTime.UtcNow, DateTime.UtcNow + TimeSpan.FromDays(1)); + private static SecurityToken specCompliantOpenIdConnect = new JwtSecurityToken("issuer", "audience", new List { new Claim("iat", EpochTime.GetIntDate(DateTime.UtcNow).ToString()), new Claim("nonce", nonceForOpenIdConnect) }, DateTime.UtcNow, DateTime.UtcNow + TimeSpan.FromDays(1)); private const string ExpectedStateParameter = "expectedState"; /// diff --git a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnectBearer/OpenIdConnectBearerMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnectBearer/OpenIdConnectBearerMiddlewareTests.cs index f51fcaaf31..596a6e61fa 100644 --- a/test/Microsoft.AspNet.Authentication.Test/OpenIdConnectBearer/OpenIdConnectBearerMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/OpenIdConnectBearer/OpenIdConnectBearerMiddlewareTests.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnectBearer options.AutomaticAuthentication = true; options.Authority = "https://login.windows.net/tushartest.onmicrosoft.com"; - options.Audience = "https://TusharTest.onmicrosoft.com/TodoListService-ManualOpenIdConnect"; + options.Audience = "https://TusharTest.onmicrosoft.com/TodoListService-ManualJwt"; options.TokenValidationParameters.ValidateLifetime = false; });