Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 4e83a67

Browse files
author
Praburaj
committed
Creating authentication ticket by passing in a principal
This fixes bug : #144
1 parent a249cbb commit 4e83a67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.AspNet.Security.OpenIdConnect/OpenidConnectAuthenticationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync()
224224
// assumption: if the ContentType is "application/x-www-form-urlencoded" it should be safe to read as it is small.
225225
if (string.Equals(Request.Method, "POST", StringComparison.OrdinalIgnoreCase)
226226
&& !string.IsNullOrWhiteSpace(Request.ContentType)
227-
// May have media/type; charset=utf-8, allow partial match.
227+
// May have media/type; charset=utf-8, allow partial match.
228228
&& Request.ContentType.StartsWith("application/x-www-form-urlencoded", StringComparison.OrdinalIgnoreCase)
229229
&& Request.Body.CanRead)
230230
{
@@ -343,7 +343,7 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync()
343343
throw new InvalidOperationException("No SecurityTokenValidator found for token: " + openIdConnectMessage.IdToken);
344344
}
345345

346-
ticket = new AuthenticationTicket(principal.Identity as ClaimsIdentity, properties);
346+
ticket = new AuthenticationTicket(principal, properties, Options.AuthenticationType);
347347
if (!string.IsNullOrWhiteSpace(openIdConnectMessage.SessionState))
348348
{
349349
ticket.Properties.Dictionary[OpenIdConnectSessionProperties.SessionState] = openIdConnectMessage.SessionState;

0 commit comments

Comments
 (0)