snowland-auth-sdk-python
Providing unified third-party OAuth login (GitHub, Gitee, CSDN, WeChat, WeChat Work, Alipay, Aliyun, 1688, etc.) as well as Snowland's native authorization.
Features
- Supports Snowland's own authorization system as well as multi-platform third-party OAuth login
- Unified
BaseOAuthClientabstraction with consistent interfaces across platforms - Synchronous / asynchronous HTTP calls powered by
snowland-http - No dependency on
requests/astartool; only the standard library andsnowland-httpare required
Supported third-party platforms
GitHub, Gitee, CSDN, WeChat, WeChat Work, Alipay, Aliyun, 1688, Snowland
Installation
pip install snowland-authsdk
Usage
Option 1: Snowland native authorization (legacy interface)
- First, register an account on the snowland-auth website.
- Create an application on the snowland-auth website to obtain the application's
access_keyandaccess_secret. - As shown in the demo:
- Create an OAuth object
from snowland_authsdk.login import OAuth
access_key = 'tuxf517fqdserop68z1m3zmf6bs6tkrf'
access_secret = '2446ea7d1722da461052d547268480b5aca159a781ccba27908a3acde887889c'
app = OAuth(access_key, access_secret)
- Redirect the URL so that the user can send a request to the third-party server
res = app.oauth_authorize(**param, **user)
- Obtain the user's
code, and use it to apply for a token from the third-party server
res = app.oauth_access_token(**{"code": code, "method":'post'})
- Use the token to request data from the third-party server
res = app.oauth_access_token(**{"code": code, "method": 'get'})
Option 2: Third-party OAuth login (new module)
Using GitHub as an example:
from snowland_authsdk.oauth import GitHubOAuthClient
client = GitHubOAuthClient(
client_id='your_client_id',
client_secret='your_client_secret',
redirect_uri='https://your-app/callback',
)
# 1. Redirect the user to the authorization page
authorize_url = client.get_authorize_url(state='random_state')
# 2. After callback, exchange the code for user info
user = client.get_userinfo(code='code_from_callback')
All platform clients live under snowland_authsdk.oauth, e.g.
GitHubOAuthClient, GiteeOAuthClient, WeChatOAuthClient,
WeChatWorkOAuthClient, AlipayOAuthClient, AliyunOAuthClient,
Alibaba1688OAuthClient, CsdnOAuthClient, SnowlandOAuthClient.
Adoption Registry
More companies adopting this project are welcome to register at the registration address. Registration is only for product promotion.
The following companies or organizations have directly or indirectly used this project:
- A.Star Algorithm Group
- Hebei Snowland Network Technology Co., Ltd.
...
Copyright and License
This product is open source and free, and will continue to provide technical support. Individual or enterprise users are free to access and use.
Licensed under the Apache v2.0 License (Apache 2.0). Copyright (c) 2019-present, Snowland Co,.Ltd
The product is open source and free of charge, and we will continue to provide technical support. Individuals and enterprises may freely integrate and use it.
Donate
No matter how much the amount is, it is enough to express your thought. Thank you very much :) To donate
No matter how much the amount is, it is enough to express your appreciation. Thank you very much :)
Release files for snowland-authsdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snowland_authsdk-0.2.0.tar.gz | 31.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snowland_authsdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.2 kB
Release files / snowland_authsdk-0.2.0.tar.gz
| Download URL | snowland_authsdk-0.2.0.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6132f869b031c1f0e0cd0c6e2b17fb960f588a9e24daa9d83f9fadd0cc357ff4
|
|
BLAKE2b-256 checksum How to use checksums |
3893dc5c7cc3def0d966d4bf2ed25f957fc70ea5e2a9bc6c97fc1c092da6217d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / snowland_authsdk-0.2.0-py3-none-any.whl
| Download URL | snowland_authsdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 45.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bfca70c4f6f38841673350806704864b65e9612d03eb87a5f12eb574221c5b7
|
|
BLAKE2b-256 checksum How to use checksums |
eb1ef28ac9001b5d1a42698ea3c75aa030a254a2ecd178ce97bf45d95c2005a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|