django-windowsauth icon indicating copy to clipboard operation
django-windowsauth copied to clipboard

Disable Authentication for specific view

Open MarthinusBosman opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Sort of, at the moment, I'm using windowsauth for my admin site, but I find that any view I make is now quite slow to load the first time because it attempts to authenticate the user first. I feel there should be some way to entirely skip any attempt at authentication for a specific view.

Describe the solution you'd like Same as for @domain_required decorator, I feel there should be a @skip_authentication decorator so that a view can just be served without attempting any login.

Describe alternatives you've considered N/A

Additional context Current view is just a simple TemplateView class:

class AppView(TemplateView):
    template_name = "app.html"

And I'd prefer to just be able to say something like:

@method_decorator(authentication_exempt, name="dispatch")
class ChatterBotAppView(TemplateView):
    template_name = "app.html"

MarthinusBosman avatar Sep 06 '22 13:09 MarthinusBosman