Brightspace / D2L.Security.OAuth2

Brightspace OAuth 2.0 for C#
Apache License 2.0
7 stars 16 forks source link

Dnxcore #36

Closed omsmith closed 7 years ago

omsmith commented 8 years ago
omsmith commented 8 years ago

This is on top of #35

j3parker commented 8 years ago

I love this

omsmith commented 8 years ago

https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/a2f781da4d310ad1b7c7b31d8fafa0d394ec7f91/src/Microsoft.IdentityModel.Tokens/AsymmetricSignatureProvider.cs#L454

So this does disposing of things. Need to figure out how/when this happens.

omsmith commented 8 years ago

So JwtSecurityHandler gets it when WriteToken is called, but doesn't dispose of it or anything (Dispose is protected, so it wouldn't be able to anyway).

Seems we'll still need to track the Disposables ourselves, which in KDev is a possibility for RSASecurityKey (https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/KDev/src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs#L48), but not in the latest nuget.

omsmith commented 8 years ago

JsonWebKey/JsonWebKeySet is a thing in IdentityModel.Tokens now, https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/KDev/src/Microsoft.IdentityModel.Tokens/JsonWebKeySet.cs

omsmith commented 8 years ago

So, as JsonWebKey/JsonWebKeySet are set up, we could use them for parsing.

JsonWebKey implements SecurityKey, and the AsymmetricSignatureProvider will do the correct thing with it, but it would have to do the correct thing multiple times, and no way for us to cache it. Sad.