在Flask应用程序中使用authlib OAuth客户端的更好示例? [英] Better examples of authlib OAuth client use with a Flask app?
问题描述
我在Flask应用程序中同时获得了密码和代码授予流程,但是感觉有点笨拙.
I have got both the password and code grant flows working with my Flask app, but it all feels a bit clunky.
我发现在oauth.register中使用 fetch_token
和 update_token
来处理令牌超时非常混乱,而且我没有发现错误处理的示例.发生了很多聪明的隐式操作,但是这些文档非常密集,至少对于不熟悉OAuth的我而言.也许我没有以正确的方式阅读文档?
I find the use of fetch_token
and update_token
in oauth.register to handle token timeout quite confusing, and I have found no examples of error handling. There is lots of clever implicit stuff going on, but the docs are dense, at least to me who is not too familiar with OAuth. Perhaps I'm not reading the docs the right way?
只有两个细节:我正在使用 fetch_access_token
进行密码授予,但是
Just two details: I'm using fetch_access_token
for the password grant, but this is not documented in the API under the Flask section, and fetch_token
is apparently both a callback function and part of the API for some Clients but not others..
我猜可以在这里逐个问题地散列每个主题,但如果有人能指出我一个更加充实的真实示例,那就更好了.
I could hash out each subject here I guess, question by question, but much better would be if somebody could point me to a more fleshed-out real-world example.
欢迎任何建议.
推荐答案
为便于记录,我想在此指出我以后的个人问题和答案.
For the record I want to point to my later individual questions and answers here.
Python authlib烧瓶-如何显式进行authorize_redirect?
Python请求authlib-SSLCertVerificationError CERTIFICATE_VERIFY_FAILED
这篇关于在Flask应用程序中使用authlib OAuth客户端的更好示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!