Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for anonymous requests #3

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

jaylynch
Copy link
Contributor

Adds the option for a request without any Authorization: JWT ... header to be passed through as an AnonymousUser (per main Django auth) rather than raise an exception.

This allows views to use FirebaseAuthentication for authentication, but still have public / generally available views, via custom permissions.

A great example is a content API for a public-facing website, allowing public, unauthenticated access to the API on a read-only basis, but requiring an admin login to POST / PUT / DELETE, etc.

The option is an opt-in, configurable via settings. DRF_FIREBASE_AUTH.ALLOW_ANONYMOUS_REQUESTS so that default behaviour is unchanged.

Copy link
Owner

@garyburgmann garyburgmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, and I agree that this should be a manual opt-in

@garyburgmann garyburgmann merged commit 734ab03 into garyburgmann:master Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants