question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom failure handler?

See original GitHub issue

We’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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JonasKscommented, Jan 14, 2021

I’d be happy to review. 👍

0reactions
peterfarrellcommented, Jan 21, 2021

Closing this issue since it was a question on if a PR would be accepted.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found