Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove several Lazy-related objects from every TokenValidationResult … #2193

Merged
merged 1 commit into from
Jul 28, 2023

Commits on Jul 28, 2023

  1. Remove several Lazy-related objects from every TokenValidationResult (#…

    …2180)
    
    * Remove several Lazy-related objects from every TokenValidationResult
    
    Creating a TokenValidationResult is also creating a `Lazy<>`, a `LazyHelper` internal to the `Lazy<>`, and a `Func<>` delegate due to the lambda passed to the lazy closing over `this`. Offline discussion also suggested that thread-safe initialization is important, including for ClaimsIdentity which isn't currently protected. So instead, this commit changes the scheme employed to use double-checked locking directly for ClaimsIdentity and then optimistic synchronization with Interlocked for Claims, as well as for the separate property bag property that was previously always instantiated.
    
    * Address PR feedback
    stephentoub authored and Brent Schmaltz committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    a50132d View commit details
    Browse the repository at this point in the history