mattmorg55 / Owin.Security.Keycloak

Keycloak Authentication Middleware for the C# OWIN Pipeline
http://keycloak.jboss.org
MIT License
17 stars 20 forks source link

FIX: Redirect to page when Keycloak authentication fails during login. #12

Closed highbyte closed 5 years ago

highbyte commented 5 years ago

Adds an optional configuration option AuthResponseErrorRedirectUrl (which can be an absolute URL or relative path from your application) that defines an URL to redirect to if Keycloak auth fails during login.

If Keycloak server fails during login, it'll redirect back to calling application (that uses this library) with information in query parameter "error" (and optionally "errordescription" and "erroruri").

If the configuration option AuthResponseErrorRedirectUrl is set , it will be used to redirect the user to that page. Query parameters "error", "errordescription" and "erroruri" is passed along from Keycloak (if they exist).

Note: Previous implementation always throwed an ArgumentException if query parameter "error" was returned from Keycloak. If the new configuration option is not used (default), an Exception still be thrown (but with additional error information from Keycloak)

highbyte commented 5 years ago

@mattmorg55 Hi, is it ok to have this change merged into dev? Also I have an upcoming pull request to make the library compatible with Keycloak4.8.

mattmorg55 commented 5 years ago

Absolutely

On Tue, Jan 22, 2019, 6:12 AM highbyte <notifications@github.com wrote:

@mattmorg55 https://github.com/mattmorg55 Hi, is it ok to have this change merged into dev? Also I have an upcoming pull request to make the library compatible with Octopus 4.8.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mattmorg55/Owin.Security.Keycloak/pull/12#issuecomment-456394172, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0-n2gWRZTHnz6V_nLdjXSIsFleRAL2ks5vFw5CgaJpZM4aH2AY .