You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
I was trying out the library and had some initial configuration problems. I found that errors were swallowed in this piece of code in KeycloakAuthenticationHandler.cs. I wonder if there could be a possibility to log these errors (and a short paragraph in the configuration guide where to find the log information). This would have saved me some time, and I would need that before going to any non-testing environment.
catch (Exception)
{
// ignored
}
The text was updated successfully, but these errors were encountered:
So to start a discussion on this topic, ASP.NET 4.5 has no formal support for file-based logging, and assumes every "fatal" error will be either gracefully handled or output as an HTTP/HTML -based error response. ASP.NET 5+ fixes with with its own logging solution, but currently this library isn't targeting that platform.
I wrote this library in the ASP.NET 4.5 mentality of "try to fix the problem if one comes up", but obviously this hides common-sense issues like configuration problems that would show up in logging immediately.
So the obvious solution here is to implement one of the various .NET logging libraries, dependent on a configuration option. So, default behavior may be the current behavior + log fatal errors to file using the logging framework. It can be configurable for no logging, or log-all and don't gracefully handle errors, etc.
I'll begin implementing this logging approach for the next major release, beginning in the next few days.
I'm not a .NET guy, I am just trying to get Keycloak to work for our setup. Maybe suggesting logging was jumping to conclusions here. Compatibility with ASP.NET 4.5 and minimal dependencies might be very valuable to the other users of the library, probably even to us.
In my case the URLs for Keycloak in the configuration and in the access token didn't match. It was great that there was a configuration option DisableIssuerValidation that solved the problem for me. But it was only by debugging that I found the reason of the problem.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I was trying out the library and had some initial configuration problems. I found that errors were swallowed in this piece of code in
KeycloakAuthenticationHandler.cs
. I wonder if there could be a possibility to log these errors (and a short paragraph in the configuration guide where to find the log information). This would have saved me some time, and I would need that before going to any non-testing environment.The text was updated successfully, but these errors were encountered: