No project description provided
Project description
authentikate
DEVELOPMENT
This project is currently under development, and tightly integrates with the arkitekt project. While we are working on a more generic solution, the project API SHOULD be considered unstable. Please use at your own risk, and consider other solutions.
Idea
Authentikate is a library that provides a simple interface to validate tokens and retrieve corresponding user information inside a django application.
Usage
In order to initialize a herre client you need to specify a specific grant to retrieve the access_token. A grant constitutes a way of retrieving a Token in an asynchronous manner.
Installation
pip install authentikate
Configuration
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"guardian",
"authentikate",
]
AUTH_USER_MODEL = "authentikate.User"
AUTHENTIKATE = {
"KEY_TYPE": "RS256",
"PUBLIC_KEY_PEM_FILE": "public_key.pem",
"FORCE_CLIENT": False,
}
Authentication is done by using the authenticate_token
method. This method takes a token and returns a user object if the token is valid. Otherwise it returns None
.
```python
from authentikate import authenticate_token, authenticate_headers
def my_view(request):
auth = authenticate_headers(request.HEADERS)
if user is not None:
# do something with user
else:
# do something else
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
Hashes for authentikate-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d011e79a4a5369b2926df2ee953c220f6d0d50f7ef1e3b666ca170a8bd3c59d |
|
MD5 | 80e59a7623ed52848cf8fd890658c4d9 |
|
BLAKE2b-256 | 37e2b83b5ff398fd193e2cbaa334dc78b6ebb736d842d80ce76cf50aae2e0538 |