From 89186da952855cbb83a181e77791a312a2d6d6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 5 Mar 2017 15:40:12 +0100 Subject: [PATCH] React to contract changes in aspnet-contrib/AspNet.Security.OpenIdConnect.Server https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server/commit/067531583a33f0a60cd08ec262902397d6f93f5d --- src/OpenIddict/OpenIddictProvider.Serialization.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/OpenIddict/OpenIddictProvider.Serialization.cs b/src/OpenIddict/OpenIddictProvider.Serialization.cs index eff2d5df..957f37b4 100644 --- a/src/OpenIddict/OpenIddictProvider.Serialization.cs +++ b/src/OpenIddict/OpenIddictProvider.Serialization.cs @@ -6,7 +6,6 @@ using System; using System.Diagnostics; -using System.Security.Claims; using System.Threading.Tasks; using AspNet.Security.OpenIdConnect.Extensions; using AspNet.Security.OpenIdConnect.Primitives; @@ -32,10 +31,7 @@ namespace OpenIddict if (!options.Value.DisableTokenRevocation) { // Resolve the subject from the authentication ticket. If it cannot be found, throw an exception. - var subject = context.Ticket.Principal.GetClaim(OpenIdConnectConstants.Claims.Subject) ?? - context.Ticket.Principal.GetClaim(ClaimTypes.NameIdentifier) ?? - context.Ticket.Principal.GetClaim(ClaimTypes.Upn); - + var subject = context.Ticket.Principal.GetClaim(OpenIdConnectConstants.Claims.Subject); if (string.IsNullOrEmpty(subject)) { throw new InvalidOperationException("The subject associated with the authentication ticket cannot be retrieved."); @@ -86,10 +82,7 @@ namespace OpenIddict if (!options.Value.DisableTokenRevocation) { // Resolve the subject from the authentication ticket. If it cannot be found, throw an exception. - var subject = context.Ticket.Principal.GetClaim(OpenIdConnectConstants.Claims.Subject) ?? - context.Ticket.Principal.GetClaim(ClaimTypes.NameIdentifier) ?? - context.Ticket.Principal.GetClaim(ClaimTypes.Upn); - + var subject = context.Ticket.Principal.GetClaim(OpenIdConnectConstants.Claims.Subject); if (string.IsNullOrEmpty(subject)) { throw new InvalidOperationException("The subject associated with the authentication ticket cannot be retrieved.");