All Projects → PedroBern → Django Graphql Auth

PedroBern / Django Graphql Auth

Licence: mit
Django registration and authentication with GraphQL.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Graphql Auth

Relay Authentication
An example app demonstrating role based authentication and file upload with Relay and GraphQL.
Stars: ✭ 153 (-23.5%)
Mutual labels:  graphql, relay, authentication, registration
Django Graphql Jwt
JSON Web Token (JWT) authentication for Graphene Django
Stars: ✭ 649 (+224.5%)
Mutual labels:  graphql, django, authentication
Django Rest Registration
User-related REST API based on the awesome Django REST Framework
Stars: ✭ 240 (+20%)
Mutual labels:  django, authentication, registration
Django Graphql Social Auth
Python Social Auth support for Graphene Django
Stars: ✭ 90 (-55%)
Mutual labels:  graphql, django, authentication
Djangosaml2
A maintenance fork of the original and no longer maintained djangosaml2 library.
Stars: ✭ 143 (-28.5%)
Mutual labels:  django, authentication
Express Graphql Boilerplate
Express GraphQL API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 201 (+0.5%)
Mutual labels:  graphql, authentication
Meteor Apollo Accounts
Meteor accounts in GraphQL
Stars: ✭ 145 (-27.5%)
Mutual labels:  graphql, authentication
Reactconfbr
Public infos and issues about React Conf Brasil organization
Stars: ✭ 156 (-22%)
Mutual labels:  graphql, relay
Registration Login Spring Xml Maven Jsp Mysql
Registration and Login Example with Spring MVC, Spring Security, Spring Data JPA, XML Configuration, Maven, JSP, and MySQL.
Stars: ✭ 134 (-33%)
Mutual labels:  authentication, registration
Laravel Graphql
Facebook GraphQL for Laravel 5. It supports Relay, eloquent models, validation and GraphiQL.
Stars: ✭ 1,793 (+796.5%)
Mutual labels:  graphql, relay
Djangochannelsgraphqlws
Django Channels based WebSocket GraphQL server with Graphene-like subscriptions
Stars: ✭ 203 (+1.5%)
Mutual labels:  graphql, django
Absinthe relay
Absinthe support for the Relay framework
Stars: ✭ 143 (-28.5%)
Mutual labels:  graphql, relay
Relay Rails Blog
A graphql, relay and standard rails application powered demo weblog. We are using Graphql server and relay for our react component data needs.
Stars: ✭ 140 (-30%)
Mutual labels:  graphql, relay
Nest User Auth
A starter build for a back end which implements managing users with MongoDB, Mongoose, NestJS, Passport-JWT, and GraphQL.
Stars: ✭ 145 (-27.5%)
Mutual labels:  graphql, authentication
Saleor
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.
Stars: ✭ 14,720 (+7260%)
Mutual labels:  graphql, django
Awesome Graphql
Awesome list of GraphQL
Stars: ✭ 13,020 (+6410%)
Mutual labels:  graphql, relay
Django Auth Tutorial
Source code for Django authentication tutorial.
Stars: ✭ 160 (-20%)
Mutual labels:  django, authentication
Graphene Django Subscriptions
This package adds support to Subscription's requests and its integration with websockets using Channels package.
Stars: ✭ 173 (-13.5%)
Mutual labels:  graphql, django
Django Rest Auth
This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
Stars: ✭ 2,289 (+1044.5%)
Mutual labels:  django, authentication
Next Advanced Apollo Starter
Advanced, but minimalistic Next.js pre-configured starter with focus on DX
Stars: ✭ 131 (-34.5%)
Mutual labels:  graphql, authentication

Django GraphQL Auth

Django registration and authentication with GraphQL.

downloads Codecov Coverage Build Status Pypi Documentation Status contributions welcome

Demo

Demo Video

About

Abstract all the basic logic of handling user accounts out of your app, so you don't need to think about it and can get up and running faster.

No lock-in. When you are ready to implement your own code or this package is not up to your expectations , it's easy to extend or switch to your implementation.

Documentation

Documentation is available at read the docs.

Features

  • [x] Awesome docs 🎉
  • [x] Fully compatible with Relay
  • [x] Works with default or custom user model
  • [x] JWT authentication (with Django GraphQL JWT)
  • [x] User query with filters (with Django Filter and Graphene Django)
  • [x] User registration with email verification
  • [x] Add secondary email, with email verification too
  • [x] Resend activation email
  • [x] Retrieve/Update user
  • [x] Archive user
  • [x] Permanently delete user or make it inactive
  • [x] Turn archived user active again on login
  • [x] Track user status (archived, verified, secondary email)
  • [x] Password change
  • [x] Password reset through email
  • [x] Revoke user refresh tokens on account archive/delete/password change/reset
  • [x] All mutations return success and errors
  • [x] Default email templates (you will customize though)
  • [x] Customizable, no lock-in

Full Schema

import graphene

from graphql_auth.schema import UserQuery, MeQuery
from graphql_auth import mutations

class AuthMutation(graphene.ObjectType):
    register = mutations.Register.Field()
    verify_account = mutations.VerifyAccount.Field()
    resend_activation_email = mutations.ResendActivationEmail.Field()
    send_password_reset_email = mutations.SendPasswordResetEmail.Field()
    password_reset = mutations.PasswordReset.Field()
    password_set = mutations.PasswordSet.Field() # For passwordless registration
    password_change = mutations.PasswordChange.Field()
    update_account = mutations.UpdateAccount.Field()
    archive_account = mutations.ArchiveAccount.Field()
    delete_account = mutations.DeleteAccount.Field()
    send_secondary_email_activation =  mutations.SendSecondaryEmailActivation.Field()
    verify_secondary_email = mutations.VerifySecondaryEmail.Field()
    swap_emails = mutations.SwapEmails.Field()
    remove_secondary_email = mutations.RemoveSecondaryEmail.Field()

    # django-graphql-jwt inheritances
    token_auth = mutations.ObtainJSONWebToken.Field()
    verify_token = mutations.VerifyToken.Field()
    refresh_token = mutations.RefreshToken.Field()
    revoke_token = mutations.RevokeToken.Field()


class Query(UserQuery, MeQuery, graphene.ObjectType):
    pass


class Mutation(AuthMutation, graphene.ObjectType):
    pass


schema = graphene.Schema(query=Query, mutation=Mutation)

Relay

Import mutations from the relay module:

from graphql_auth import relay

class AuthMutation(graphene.ObjectType):
   register = relay.Register.Field()
   # ...

Example

Handling user accounts becomes super easy.

mutation {
  register(
    email: "[email protected]",
    username: "new_user",
    password1: "123456super",
    password2: "123456super",
  ) {
    success,
    errors,
    token,
    refreshToken
  }
}

Check the status of the new user:

u = UserModel.objects.last()
u.status.verified
# False

During the registration, an email with a verification link was sent.

mutation {
  verifyAccount(
    token:"<TOKEN ON EMAIL LINK>",
  ) {
    success,
    errors
  }
}

Now user is verified.

u.status.verified
# True

Check the installation guide or jump to the quickstart. Or if you prefer, browse the api.

Contributing

See CONTRIBUTING.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].