-
Notifications
You must be signed in to change notification settings - Fork 413
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
[Bug] custom SignatureProvider breaks after upgrading .NET 8 #2418
Comments
The same issue with
This method is no longer called by
is called instead and there is no way one can override it since it is internal. |
Experiencing same issue with |
Ran into the same issue as well. Will have to keep my sample on 7.1.2 to allow it to function. |
@juunas11 @KelDazan @yodasad @superyyrrzz i see the issue. We will have to open up that method. |
We can't make the method abstract in 7.x as it is breaking. We understand this is inconvenient / not a great experience as it is. We need to make that change in 8.x for the reasons mentioned above. We can at least open up the virtual |
fixed in 7.4.0 |
@jennyf19 we allowed for extensibility, I don't see an item with IM8 tag to make these methods abstract like they should be. Do we want to reopen this or open a new issue to track? |
Repro
Our services met an outage due to a breaking change in .NET 8 (https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/8.0/securitytoken-events) related to SignatureProvider Change.
In our service's existing code in .NET 6, we inherite
SignatureProvider
and overridepublic abstract bool Verify(byte[] input, byte[] signature)
.However due to the breaking change in .NET 8, this method is not invoked. Instead, the new
JsonWebTokenHandler
calls the new methodpublic virtual bool Verify(byte[] input, int inputOffset, int inputLength, byte[] signature, int signatureOffset, int signatureLength)
. This new method throwsNotImplementedException
as we are not aware to implement it.Expected behavior
I propose to update the signature from
virtual
toabstract
. Usually this is not friendly by forcing all the inheritance to implement a new method. However in this case, a compilation error to devs is more preferred over a runtime exception affecting our customers. If we can notice in advance when upgrading .NET 8, we may possiblely turn onUseSecurityTokenValidators
to avoid breaking.Actual behavior
The new virtual method is invoked by default in .NET 8's JsonWebToken, which throws
NotImplementedException
.The text was updated successfully, but these errors were encountered: