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

Provide Django authentication backend for token authentication #27

Open
vikoivun opened this issue Oct 16, 2020 · 3 comments
Open

Provide Django authentication backend for token authentication #27

vikoivun opened this issue Oct 16, 2020 · 3 comments

Comments

@vikoivun
Copy link
Member

Currently we only provide token based authentication backend for the DRF specific authentication mechanism.

Non surprisingly Graphene based backends cannot use this. They use the standard Django authentication mechanisms instead. Thus we need to provide support for them.

open-city-profile has implemented a wrapper that can be used as source of inspiration:
https://github.com/City-of-Helsinki/open-city-profile/blob/develop/open_city_profile/oidc.py

Also check if pysocial already has something for the token use case:
https://python-social-auth.readthedocs.io/en/latest/configuration/django.html

@akikoskinen
Copy link
Contributor

This issue mentions two things:

  1. Provide Django authentication middleware (I suppose the term "backend" in this issue's subject really means "middleware") for token authentication
  2. Provide mechanism for token authentication in Graphene based systems

While both are probably useful, these aren't necessarily the same thing.

There is now this new authenticator system that has no opinions about any used frameworks (other than Django needs to be present). Could this satisfy the second point in the list above?

@vikoivun
Copy link
Member Author

This issue mentions two things:

  1. Provide Django authentication middleware (I suppose the term "backend" in this issue's subject really means "middleware") for token authentication
  2. Provide mechanism for token authentication in Graphene based systems

While both are probably useful, these aren't necessarily the same thing.

There is now this new authenticator system that has no opinions about any used frameworks (other than Django needs to be present). Could this satisfy the second point in the list above?

Actually, I would've expected that the new authenticator satisfies both points. Do you think something more would be needed to support fe. open-city-profile ?

@akikoskinen
Copy link
Contributor

The new authenticator is enough as is for open-city-profile. It won't be using the Django authentication framework because it's ill suited for the GraphQL case.

But a new Django authentication middleware should be quite easy to implement based on the new authenticator.

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

No branches or pull requests

2 participants