99using System . Security . Claims ;
1010using System . Threading . Tasks ;
1111using AspNet . Security . OAuth . Extensions ;
12- using Microsoft . AspNet . Authentication ;
13- using Microsoft . AspNet . Authentication . OAuth ;
14- using Microsoft . AspNet . Http . Authentication ;
15- using Microsoft . Extensions . Internal ;
12+ using JetBrains . Annotations ;
13+ using Microsoft . AspNetCore . Authentication ;
14+ using Microsoft . AspNetCore . Authentication . OAuth ;
15+ using Microsoft . AspNetCore . Http . Authentication ;
16+ using Microsoft . Extensions . Logging ;
1617using Newtonsoft . Json . Linq ;
1718
1819namespace AspNet . Security . OAuth . < %= name % > {
@@ -31,7 +32,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync([NotNull]
3132 response . EnsureSuccessStatusCode ( ) ;
3233
3334 var payload = JObject . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
34-
35+
3536 identity . AddOptionalClaim ( ClaimTypes . NameIdentifier , < %= name % > AuthenticationHelper . GetIdentifier ( payload ) , Options . ClaimsIssuer ) ;
3637
3738 // TODO: Add any optional claims, eg
@@ -47,7 +48,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync([NotNull]
4748 if ( context . Principal ? . Identity == null ) {
4849 return null ;
4950 }
50-
51+
5152 return new AuthenticationTicket ( context . Principal , context . Properties , context . Options . AuthenticationScheme ) ;
5253 }
5354 }
0 commit comments