Skip to main content

A variant of djhango-graphql-jwt that can work with federations

Project description

Introduction

Customizable backend that uses graphql to authenticate users. Abstraction of a graphql authentication mechanism. This is an modification of django-graphql-jwt: I drop some functionalities that I did not care and add capabilities that I needed.

Capabilities dropped:

  • cookies;

Capabilities added:

  • custom names and exceptions for authentication graphql mutrations/queries (needed for federations);
  • ability to customize authentication mechanism;
  • ability to work with graphene-federations when there are multiple authentication mechanisms;
  • ability to be easily extended;

Motivation

I needed to work with graphene federations wehere there werre multiple graphqlk mutations with names like "login", "me", "refresdh_tokens" and so on. django-graphql-jwt was more an hindrance than anything else since I need to authenticate via a token rather tha username and password. In the end I ported the feature I needed from django-graphql-jwt and created this variant.

This apps does not rely on its oiwn authentication mechanism, but just relay all the information it knows about the graphql request to the auithentication backend. In this way you are in charge to perform authentication.

Still, the package provides some standard authentication mechanism you can use.

Installation

pip install django-graphql-apitoken

Configuration

You need to add this app to the INSTALLED_APPS:

INSTALLED_APPS += "django_graphql_apitoken"

The second step is to create the authentication classes that graphene needs to be aware of. Create a new file in your project root and add the following:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file django_graphene_authentication-1.0.38-py3-none-any.whl.

File metadata

  • Download URL: django_graphene_authentication-1.0.38-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.3

File hashes

Hashes for django_graphene_authentication-1.0.38-py3-none-any.whl
Algorithm Hash digest
SHA256 32c421100237981ff8a931a3d88a5d97f6ed8e2f3df817f7df1100daf5444b29
MD5 7e17dde5a0c8f6ea1a876a3c3b7950c6
BLAKE2b-256 772b7f828306821b5492a5f5a48868f8ff6ba83cd4ba535cac07748913cbb877

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page