Closed rebeccapowell closed 3 years ago
@brunohbrito Can you check this?
Hi @rebeccapowell
By default this component use ECDsa to generate the Keys and by your example we can see you are trying to use a RSA
new EncryptingCredentials(key.Key, SecurityAlgorithms.RsaOAEP, SecurityAlgorithms.Aes128CbcHmacSha256);
If you go to your startup.cs
and change it to:
services.AddJwksManager(options => options.Algorithm = Algorithm.RS256)
Then it should work.
This component was designed to work with JWS. The algoritms it supports are those listed at RFC 7518 - JWS section. Maybe it could have some differences between JWE alg's
I'll work in a version to support JWE algs.
@rebeccapowell Hi!
There are support for Jwe now. Search for NetDevPack.Security.Jwt
. And it's fully integrated with ASP.NET Core DataProtection to store keys.
When defining the SecurityTokenDescriptor, you can not only set the SigningCredentials, but the EncryptingCredentials as well.
Is there a way to use the same key to set the EncryptingCredentials as well. I've been trying the following, but I've been getting an exception, and I'm not sure how to solve it:
Exception is: