You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OnUpdateClientAssertion event is invoked without an await, probably because it is inside a lock. This can potentially cause hard to diagnose bugs if the event is assigned to something that requires awaiting. For example the current HttpContext is one of the properties, and using it after the request is ended can throw object disposed exceptions.
My suggestion is to replace the lock with a SemaphoreSlim which works fine in async context as well, and the lifetime of OAuth2IntrospectionOptions shouldn't be a problem as SemaphoreSlim wouldn't need to be disposed in this case.
Tangentially, ConfigureAwait(false) is missing from some all awaits on events. Is this intentional or an oversight?
The text was updated successfully, but these errors were encountered:
https://github.com/IdentityModel/IdentityModel.AspNetCore.OAuth2Introspection/blob/main/src/OAuth2IntrospectionHandler.cs#L211
The
OnUpdateClientAssertion
event is invoked without anawait
, probably because it is inside alock
. This can potentially cause hard to diagnose bugs if the event is assigned to something that requires awaiting. For example the current HttpContext is one of the properties, and using it after the request is ended can throw object disposed exceptions.My suggestion is to replace the lock with a
SemaphoreSlim
which works fine in async context as well, and the lifetime ofOAuth2IntrospectionOptions
shouldn't be a problem as SemaphoreSlim wouldn't need to be disposed in this case.Tangentially,
ConfigureAwait(false)
is missing from some all awaits on events. Is this intentional or an oversight?The text was updated successfully, but these errors were encountered: