authing / authing-py-sdk Goto Github PK
View Code? Open in Web Editor NEWAuthing SDK for Python
Home Page: https://docs.authing.cn/v3/reference/sdk/python/install.html
License: MIT License
Authing SDK for Python
Home Page: https://docs.authing.cn/v3/reference/sdk/python/install.html
License: MIT License
In [9]: client = Authing(clientId, secret)
...:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-9-4ad802168686> in <module>
----> 1 client = Authing(clientId, secret)
~/pro/trade-server/env/lib/python3.7/site-packages/authing/authing.py in __init__(self, clientId, secret, userToken)
132 }
133
--> 134 with open('./pub.pem', mode='rb') as pubFile:
135 keyData = pubFile.read()
136 self.pubKey = rsa.PublicKey.load_pkcs1_openssl_pem(keyData)
FileNotFoundError: [Errno 2] No such file or directory: './pub.pem'
Any related document?
Minimal code-snippet showcasing the problem
self.use_unverified_ssl = use_unverified_ssl or FALSE
...
verify = not self.use_unverified_ssl
r = requests.request(..., verify=verify, ...)
not FALSE
is False
respect the https verification requirement
/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.authing.cn'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
Minimal code-snippet showcasing the problem
authentication_client = AuthenticationClient(
app_id='x',
app_host="x",
app_secret='x',
)
token = "x"
authentication_client.get_user_info_by_access_token(token)
返回用户资料
return session.request(method=method, url=url, **kwargs)
E TypeError: request() got an unexpected keyword argument 'token'
我看了下代码,应该在ProtocolHttpClient
的request方法内添加如下内容:
if "token" in kwargs:
headers["authorization"] = "Bearer %s" % kwargs.pop("token")
添加后可以正常调用该方法。
authing-py-sdk/authing/v2/common/graphql.py
Lines 41 to 42 in 4f0dece
The fetch_schema_from_transport
has been enabled by default and thus each client initialization would preflight with a redundant schema introspection request. The GraphQL client should be cached if a token has not expired for performance improvement.
服务端获取到code之后换取access_token和id_token,但是AuthenticationClient Class有验证access_token的合法性的函数,没有验证id_token的合法性的函数。然而官方文档 描述是有个 validate_token方法验证id_token的合法性的。是否可以加上这个函数?
希望添加validate_token方法验证id_token的合法性
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.