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
{{ message }}
Repository navigation
[Bug] Avoid IHttpContextAccessor as much as possible.Β #248
Which Version of Microsoft Identity Web are you using ?
Microsoft Identity Web 0.1.5-preview
Repro
Avoid IHttpContextAccessor as much as possible:
It gives a false sense of security. Everywhere where we can access the HttpContext directly we should do so. Itβs not obvious in the multi-threaded methods that they use the HttpContext (which is not thread safe). Hiding that we use it leads to unsafe use.
A lot of time, the HttpContext is passed to access one field. There is a balance between the simple developer experience and
the safety. Secretly accessing the HttpContext is not on the right side of the balance. For instance:
ReplyForbiddenWithWwwAuthenticateHeader should pass in the HttpContext rather than relying on the accessor, it's called directly from a controller anyways (See TokenAcquisition.cs#L506)
Activity
jmprieur commentedon Jun 26, 2020
jennyf19 : the work you've been doing on adding suggested cache key in the TokenSerializationArgs will remove a lot of this work
jmprieur commentedon Jun 30, 2020
Blocked until we have the cacheKey for the token cache providers.
jmprieur commentedon Jul 13, 2020
Verified we've removed all what we could.
jennyf19 commentedon Jul 13, 2020
Included in 0.2.0-preview release
Related to:
Jennyf/http investigation (#339)