Skip to main content

No project description provided

Project description

# A Simplified OAuth2 Library
## No special configuration required
No special configuration required, use the examples in the sample directory to run.
The default configuration has the following limitations:
Problem 1: Restarting the service will invalidate previous login information.
This is because fastoauth generates a random secret_key each time it starts, and tokens generated with the old secret_key will become invalid.
Problem 2: Tokens cannot be shared between multiple OAuth processes.
Since different processes generate different random secret_keys, tokens cannot be parsed by different processes.
Problem 3: Issued tokens cannot be revoked.
Since tokens are not stored by default and their validity is verified by decryption each time, issued tokens cannot be revoked within their validity period.

## Configuring the secret_key
It is generally recommended to set a secret_key or use Redis for better availability.
This can solve problems 1 and 2 in the default configuration.

> Note: After configuring Redis, the secret_key setting is invalid. Please refer to the Redis section for details.
---
Generating the secret_key
```
openssl rand -hex 32
```

If you don't have the openssl command, you need to install it separately.

```
# Installation on Windows, refer to https://zhuanlan.zhihu.com/p/108833705 for choco installation
choco install openssl -y
```

## Configuring Redis
It is generally recommended to configure Redis for the highest security.
After configuring Redis, all problems in the default configuration can be solved.
At the same time, after configuring Redis, only shorter tokens need to be used during HTTP transmission, and richer content can be stored in Redis.

# A simplified server-side example
In the project directory ./sample/oauth_server.py

Project details


Download files

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

Source Distribution

fastoauth-0.1.6.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

fastoauth-0.1.6-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file fastoauth-0.1.6.tar.gz.

File metadata

  • Download URL: fastoauth-0.1.6.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for fastoauth-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7722b5b4b7265dde0accc5b8990e91e3a87b7ac361878aa80db1894b1aae4d75
MD5 2bb2b3dd85ac05e3b1936eddc4d81b49
BLAKE2b-256 d4ee471cc1dfdf40cfbd2808fc76f8c734482decd5ab0e043a615b0a85d8a21c

See more details on using hashes here.

File details

Details for the file fastoauth-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fastoauth-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for fastoauth-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 75980dda59b8bc967787d61e02346ea8fb3baaeb8d1b585384d1224ab023d43e
MD5 ac6e135aef783715150cb3d063633ae5
BLAKE2b-256 d15dcf874f715afb122b1b505ac6fbd4b1e19f00fecb10690d6d09fa0d260e0c

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