Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harrelchris/evesso
Python SSO Authorization for Eve Online API applications
https://github.com/harrelchris/evesso
api esi eve-online eveonline sso
Last synced: 2 months ago
JSON representation
Python SSO Authorization for Eve Online API applications
- Host: GitHub
- URL: https://github.com/harrelchris/evesso
- Owner: harrelchris
- License: mit
- Created: 2022-02-07T07:49:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T09:17:00.000Z (8 months ago)
- Last Synced: 2024-11-10T16:53:47.492Z (3 months ago)
- Topics: api, esi, eve-online, eveonline, sso
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EveSSO
SSO Authorization for Eve Online.
## About
This library implements the native SSO authorization flow as described [here](https://docs.esi.evetech.net/docs/sso/native_sso_flow.html). EveSSO will perform the authorization process as needed, store your access and refresh tokens, and refresh your access token as needed. It will then provide the required header for your requests.
## Installation
```shell
pip install evesso
```## Quickstart
```python
from evesso import SSO
import requestssso = SSO(
client_id='1234567890asdfghjklqwertyuiop',
callback_url='http://localhost/',
scope='esi-characters.some_scope.v1 esi-characters.some_scope.v1'
)
response = requests.get(
'https://esi.evetech.net/latest/markets/structures/SOME_STRUCTURE_ID/?datasource=tranquility',
headers=sso.get_header()
)
response.raise_for_status()
print(response.json())
```### Using .env file
```dotenv
CLIENT_ID=1234567890asdfghjklqwertyuiop
CALLBACK_URL=http://localhost/
SCOPE="esi-characters.some_scope.v1 esi-characters.some_scope.v1"
```Esi will check environment variables for credentials if not parameterized.
```python
from evesso import SSO
from dotenv import load_dotenv
import requestsload_dotenv()
sso = SSO()
response = requests.get(
'https://esi.evetech.net/latest/markets/structures/SOME_STRUCTURE_ID/?datasource=tranquility',
headers=sso.get_header()
)
response.raise_for_status()
print(response.json())
```## Authorizing on a remote machine
1. Set the `cli` parameter to `True`.
2. The auth url will be printed to the command line.
3. Open the auth url in a browser and complete the auth process
4. The SSO server will make a get request to the machine where you opened the auth url
5. Copy the callback url and paste it into the command line so evesso can parse it```python
from evesso import SSOsso = SSO(cli=True)
...
```