Open DevEnable opened 5 hours ago
As an example, over the last couple of days I have been troubleshooting an issue as to why I couldn't authenticate. I was able to replicate the issue with Postman (which I needed to fall back on as there was no easy way to do it), and then eventually I dug up the repository to look at the code and was able also replicate the same issue in .NET.
The only way to actually troubleshoot right now is via a debugger. Which doesn't leave a lot of confidence in supporting a Kinde solution in production.
Prerequisites
What is the problem you’re trying to solve?
I think the current approach that Kinde has towards exception management in that SDK could do with some improvement. Here's Kinde's code when authentication fails.
There's two issues with this:
ApplicationException
is thrown as the actual error is never reported, just a generic "no token received" error message. This is going to be problematic when troubleshooting issues outside of a developers local machine (e.g. production). If data sensitivity is a concern at least allow for a config value to allow for sensitive exceptions to be thrown (just like with the .NET OIDC libraries you can have a config setting to allow for PII data to be output)ApplicationException
. Both Microsoft and Jetbrains state in their base practices and code analytics do not throw ApplicationException (official docs). The problem with throwing just the baseException
andApplicationException
types is that they are so general they give very little indication with what went wrong. I would suggest throwing a custom Kinde exception or using one of the .NET security or HTTP exception types.For my purposes I'm mainly concerned with issue 1. I can live with the
ApplicationException
issue but I suspect it might cause downstream issues for Kinde, particularly with enterprise .NET customers as they tend to have more stringent standards reinforced by static code analysis.What solution would you like to see?
As per the problem.
ApplicationException
and consider more appropriate exception types.Additional information
No response