@@ -71,8 +71,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
71
71
}
72
72
73
73
using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
74
- var context = new OAuthCreatingTicketContext ( new ClaimsPrincipal ( identity ) , properties , Context , Scheme , Options , Backchannel , tokens , payload . RootElement ) ;
74
+
75
+ var principal = new ClaimsPrincipal ( identity ) ;
76
+
77
+ var context = new OAuthCreatingTicketContext ( principal , properties , Context , Scheme , Options , Backchannel , tokens , payload . RootElement ) ;
75
78
context . RunClaimActions ( ) ;
79
+
76
80
await Events . CreatingTicket ( context ) ;
77
81
return new AuthenticationTicket ( context . Principal , context . Properties , Scheme . Name ) ;
78
82
}
@@ -82,8 +86,6 @@ private async Task<string> ProcessIdTokenAndGetContactIdentifierAsync(
82
86
[ NotNull ] AuthenticationProperties properties ,
83
87
[ NotNull ] ClaimsIdentity identity )
84
88
{
85
- var contextIdentifier = string . Empty ;
86
-
87
89
var idToken = tokens . Response . RootElement . GetString ( "id_token" ) ;
88
90
89
91
if ( Options . SaveTokens )
@@ -94,6 +96,8 @@ private async Task<string> ProcessIdTokenAndGetContactIdentifierAsync(
94
96
95
97
var tokenValidationResult = await ValidateAsync ( idToken , Options . TokenValidationParameters . Clone ( ) ) ;
96
98
99
+ var contextIdentifier = string . Empty ;
100
+
97
101
foreach ( var claim in tokenValidationResult . ClaimsIdentity . Claims )
98
102
{
99
103
if ( claim . Type == SuperOfficeAuthenticationConstants . ClaimNames . ContextIdentifier )
0 commit comments