Skip to main content

Authentication lib for Tangent Micro Services

Project description

# PythonAuthenticationLib

A library for authenticating against the UserService

## Installation

pip install tokenauth

## Usage

Add to installed apps:


Add to middleware:



**Add authentication backends**


## this will allow you to authenticate against the userservice with a token
## this will allow you to authenticate against the userservice with a username and password

**Notes:** It is advisable to include `UserServiceAuthBackend` after `ModelBackend`.
Since `UserServiceAuthBackend` will sync the user returned from the UserService, it will be preferable to login using the local synced user rather than hitting the UserService each time.
From the frontend this will be transparent.

**Add userservice url**




You can now authenticate against the UserService:

from django.contrib.auth.models import User

# TokenAuthBackend

# UserServiceAuthBackend
user.authenticate(username, password)

Project details

Download files

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

Files for tangent-tokenauth, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size tangent-tokenauth-0.1.0.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page