Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (32 loc) · 1.29 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.29 KB

Deprecated

See ScribeAuth or ScribeAuthNode instead.

Scribe auth

Python package for interacting with Scribe's auth api.

Most calls to Scribe's api on https://api.scribelabs.ai require a JWT for authentication and authorisation. This library simplifies this process.

You first need a Scribe account and an api key. Both can be requested at contact[atsign]scribelabs[dotsign]ai.


This library requires a version of Python 3 that supports typings.

Installation

pip install scribe-auth

1. Fetching an access token and a refresh token

from scribe_auth import get_tokens
tokens = get_tokens('myusername', 'mypassword', 'myapikey')
# tokens = {"access": "token", "refresh": "token"}

2. Refreshing an access token with a refresh token

from scribe_auth import refresh_access_token
token = refresh_access_token('myrefreshtoken', 'myapikey')
# token = {"access": "token"}

3. Revoke a refresh token and associated access tokens

from scribe_auth import revoke_refresh_token
revoke_refresh_token('myrefreshtoken', 'myapikey')

To flag an issue, open a ticket on Github.