From 3483842ab76d4198fc230c7a1905b0ada9b4bf89 Mon Sep 17 00:00:00 2001 From: BrentSchmaltz Date: Wed, 28 Jan 2015 10:27:55 -0800 Subject: [PATCH] Rollback of setting Principal on AuthenticationTicket. adjust formating of messages. --- .../OpenidConnectAuthenticationHandler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs b/src/Microsoft.AspNet.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs index b237b6be97..94fe211475 100644 --- a/src/Microsoft.AspNet.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs +++ b/src/Microsoft.AspNet.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs @@ -99,7 +99,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect string redirectUri = notification.ProtocolMessage.CreateLogoutRequestUrl(); if (!Uri.IsWellFormedUriString(redirectUri, UriKind.Absolute)) { - _logger.WriteWarning("The logout redirect URI is malformed: " + redirectUri); + _logger.WriteWarning("The logout redirect URI is malformed: {0}", (redirectUri ?? "null")); } Response.Redirect(redirectUri); @@ -195,7 +195,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect string redirectUri = notification.ProtocolMessage.CreateAuthenticationRequestUrl(); if (!Uri.IsWellFormedUriString(redirectUri, UriKind.Absolute)) { - _logger.WriteWarning("Uri.IsWellFormedUriString(redirectUri, UriKind.Absolute) returned 'false', redirectUri is: " + (redirectUri ?? "null")); + _logger.WriteWarning("Uri.IsWellFormedUriString(redirectUri, UriKind.Absolute) returned 'false', redirectUri is: {0}", (redirectUri ?? "null")); } Response.Redirect(redirectUri); @@ -343,7 +343,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect throw new InvalidOperationException("No SecurityTokenValidator found for token: " + openIdConnectMessage.IdToken); } - ticket = new AuthenticationTicket(principal, properties, Options.AuthenticationType); + ticket = new AuthenticationTicket(principal.Identity as ClaimsIdentity, properties); if (!string.IsNullOrWhiteSpace(openIdConnectMessage.SessionState)) { ticket.Properties.Dictionary[OpenIdConnectSessionProperties.SessionState] = openIdConnectMessage.SessionState;