https://github.com/threefoldtech/oauth-proxy
oauth proxy
https://github.com/threefoldtech/oauth-proxy
Last synced: 9 months ago
JSON representation
oauth proxy
- Host: GitHub
- URL: https://github.com/threefoldtech/oauth-proxy
- Owner: threefoldtech
- License: apache-2.0
- Created: 2020-05-11T08:45:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-12T08:32:36.000Z (about 2 years ago)
- Last Synced: 2023-10-13T02:11:36.179Z (about 2 years ago)
- Language: Python
- Size: 22.5 KB
- Stars: 0
- Watchers: 15
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oauth proxy
This server will handle 3bot connect authentication and verification, eliminating the need to handle it in other services that are using `3bot connect`.
## Running the server
Install the requirements:
```bash
pip3 install -r requirements.txt
```
Make sure to have the secret in `/opt/key.priv` encoded usnig a `Base64` encoding, an example using `pyNaCl`:
```python
k = nacl.signing.SigningKey.generate() # Ususally the key is generated using a seed
k.encode(encoder=nacl.encoding.Base64Encoder).decode() # What should be in the file
```
The application is a simple bottle server, and it can be run using `uwsgi`as follows:
```bash
uwsgi --http :{port number} -w server
```
## Using the oauth server in your application
In order to use this server the application server must have follwing two endpoints:
- An endpoint that gets the public key from the Oauth server and redirects the user to `3bot connect` correct url
- A callback endpoint that receives the data from `3bot connect` and sends it to Oauth server to verify
You can find a crystal lang and python example [here](examples/README.md).