Paas-Word authentication for Django
Project description
Paas-Word Django Authentication Middleware
Paas-Word is an online authentication and user management service. This Python Django middleware by Paas-Word enables website owners with a Django backend to restrict their endpoints to authenticated users only and retrieve user data.
Usage
- Create a free account at Paas-Word website.
- Recieve a login, sign-up, account and forgot-password pages for your website based on the user attributes you set up.
- Set the callback pages on your website where users will be redirected after they sign-up and log in.
- Once a user is redirected to your website with a token, send this token to your backend in the "x-auth-token" header.
Installation
Run:
pip3 install paasword
Add "paasword" to settings.py :
INSTALLED_APPS = [
...
'paasword',
]
Set Private Key as Environment Variable
Create an app on Paas-Word and then set its Private Key as an environment variable on your server.
export PAASWORD_APP_PRIVATE_KEY=93f56f52-957d-4953-93a6-c5492e79778b
Gaurd all endpoints
Add middleware to settings.py :
MIDDLEWARE = [
...
'paasword.middleware.Authenticate',
]
Gaurd spesific routes against unauthenticated users
Remove comment from middleware.py. As an example:
if request.path.startswith('/snippets/'):
return self.get_response(request)
Retrieve user information
Call request.user
def snippet_list(request):
if request.method == 'GET':
print (request.user)
snippets = Snippet.getAll()
return JsonResponse(snippets, safe=False)
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paasword-1.0.1.tar.gz.
File metadata
- Download URL: paasword-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5492e20baf8923f59033d31a62e9342a233952f8e15eddbd7751f7dc87262b3b
|
|
| MD5 |
ffa4b8f00d8747145c6a10553644b166
|
|
| BLAKE2b-256 |
e62c8698a88a4062371d89306cbf13320089ea7df578d432767c6b4aac04346e
|
File details
Details for the file paasword-1.0.1-py3-none-any.whl.
File metadata
- Download URL: paasword-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66985670bfb288bd225b40f272fe6cd217c3d5536be571b403be451f1a526b75
|
|
| MD5 |
564149c83b65ffef6bd9b7ef7c682cf5
|
|
| BLAKE2b-256 |
61007c7d78e0536daf85244b21466652dedba46650889c2acd53f0dc643808e7
|