Skip to content

Commit 4c2135f

Browse files
Add null check for TokenEndpointRequest in code exchange callback
1 parent d85aaa5 commit 4c2135f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

access-token-management/src/AccessTokenManagement.OpenIdConnect/Internal/ConfigureOpenIdConnectOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ async Task Callback(AuthorizationCodeReceivedContext context)
122122
.GetClientAssertionAsync(ClientName, ct: context.HttpContext.RequestAborted)
123123
.ConfigureAwait(false);
124124

125-
if (assertion != null)
125+
if (assertion != null && context.TokenEndpointRequest != null)
126126
{
127-
context.TokenEndpointRequest!.ClientAssertionType = assertion.Type;
127+
context.TokenEndpointRequest.ClientAssertionType = assertion.Type;
128128
context.TokenEndpointRequest.ClientAssertion = assertion.Value;
129129
}
130130
}

0 commit comments

Comments
 (0)