-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add data protection to DatabaseJsonWebKeyStore and FileSystemStore #64
Comments
I agree with you and have some additional thoughts on this matter. This component was created to handle JWT in high availability scenarios. One of the reasons for not encrypting data before persisting it in other stores is that we cannot guarantee developers will configure DataProtection properly. In high availability scenarios, where multiple instances may exist, some of them might be unable to decrypt the content, leading to exceptions in the component. However, the DefaultStore (added in more recent versions) uses Although I have explained the reasons, I no longer hold a strong opinion on this matter. What are your thoughts on this? |
Well first of all thanks for the lib! I was playing with it a lot and found it very nice. In my final approach I decided to change implementation of JwtService and KeyMaterial. This solved the following things for me:
I also noticed that I can't really make a key invalid so a new key will be generated if I can't And yes I added a semaphore for And one more thing - you remember the issue with casing in the key. The problem here is the lib doesn't behave well if for some reason such issue happens. Becuase it simply throws the exception from We can close this discussion - just wanted to share my findings on this :-) |
Recently switch from
DataProtectionStore
toDatabaseJsonWebKeyStore
and noticed that no DataProtection is present.It looks to me that mentioned stores are generally less secure than default one.
Note that for example
MsalDistributedTokenCacheAdapterOptions
has an option to Encrypt (default false):I added protection to
DatabaseJsonWebKeyStore
like this:With:
But I think would be nice to have it in the stores out of the box.
The other option will be to add protection at a higher level for
KeyMaterial
but that won't work good for some scenarios. For example I'd like to store a public key separately so I can access it from other services but keep private key only to the specific service.The text was updated successfully, but these errors were encountered: