Custom failure handler?
See original GitHub issueWe’d like to customize the failure page. Would you be open to a pull request that allows you to optionally set a path to view function where both the view function can customized in additional to which template is used? If not defined, the current django-adfs-auth failure would be used.
Something similar to how DjangoSAML2 does it: https://github.com/knaperek/djangosaml2#custom-error-handler
AUTH_ADFS = {
"FAILURE_RESPONSE_VIEW_FUNCTION": ''python.path.to.your.template_failure"
}
This should be a view which takes a request, optional exception which occurred and status code, and returns a response to serve the user. The default implementation looks like this:
def template_failure(request, exception=None, **kwargs):
""" Renders a simple template with an error message. """
return render(request, 'django_adfs_auth/login_error.html', {'exception': exception}, status=kwargs.get('status', 403))
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Spring Security Custom AuthenticationFailureHandler
Learn how to customize application's authentication failure handler by using the Spring's AuthenticationFailureHandler interface.
Read more >Spring Security Authentication Failure Handler Examples
Spring security code examples to run custom logics upon failed login attempt (authentication failure handler)
Read more >spring-tutorial/custom-authentication-failure-handler.md at ...
@Override public void configure(HttpSecurity http) throws Exception { http.formLogin().failureHandler(CustomAuthenticationFailureHandler()); }.
Read more >Spring Security custom authentication failure handler redirect ...
But when I use custom authentication failure handler (as shown below), it always returns: url/login.html getRedirectStrategy().
Read more >How to Handle Spring Security Exceptions
Authentication Success Handler; Authentication Failure Handler; Access Denied Handler. Firstly, let's take a closer look at the configuration. 3 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’d be happy to review. 👍
Closing this issue since it was a question on if a PR would be accepted.