Python中文
首页
教程
问答
标签
搜索
登录
注册
fastapi中的重定向uri不匹配
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我希望大家都好。我正在尝试在我的fastapi应用程序上实现google sso。在输入用户凭据后,它会被输入,并在重定向时被重定向。我收到此错误</p> <pre><code>google_sso = GoogleSSO("client-id", "client-secret", "http://127.0.0.1:8000/google/callback/") @app1.get("/google/login") async def google_login(): """Generate login url and redirect""" return await google_sso.get_login_redirect() @app1.get("/google/callback") async def google_callback(request: Request): """Process login response from Google and return user info""" user = await google_sso.verify_and_process(request) print("Hellooooooooooooooo") print(user, "11111111111111") return { "id": user.id, "picture": user.picture, "display_name": user.display_name, "email": user.email, "provider": user.provider, } </code></pre> <p>我在下面的屏幕截图中分享了google dashboard中的URL配置</p> <p><a href="https://i.stack.imgur.com/zbpVr.png" rel="nofollow noreferrer">enter image description here</a></p> <p>我在下面提到的错误</p> <pre><code>oauthlib.oauth2.rfc6749.errors.CustomOAuth2Error: (redirect_uri_mismatch) Bad Request </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<ol> <li>尝试使用127.0.0.1:8000/google/callback#remove/</li> </ol> <p>或</p> <ol start=“2”> <li>修复url@app1.get(“/google/callback/”)#添加/</li> </ol>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何将python输出重定向到python控制台和Windows中的文本文件
2 回答
如何将Python运行时嵌入运行在Windows上的R包中
5 回答
如何将python进程作为另一个Windows us运行
6 回答
如何将Python进程的输出用Python管道传输?
6 回答
如何将Python进程的输出重定向到Rust进程?
9 回答
如何将python连接到Azure云并创建Azure数据工厂
8 回答
如何将Python连接到Db2
8 回答
如何将python连接到IBMDB2?
9 回答
如何将Python连接到microsoftaccess数据库文件?
2 回答
如何将python连接到MySQL服务器
2 回答
如何将Python连接到Node.js?
4 回答
如何将python连接到Oracle Application Express
6 回答
如何将Python连接到PostgreSQL
6 回答
如何将Python连接到Postgres服务器?
2 回答
如何将Python连接到SAS Enterprise Guide(EG)服务器
5 回答
如何将Python连接到Spark会话并保持RDDs的Ali
5 回答
如何将python连接到sqlite3并在上填充多行
5 回答
如何将python连接到使用docker运行的cassandra
7 回答
如何将python退格应用于字符串
10 回答
如何将python逻辑应用到tkinter GUI中?这是一个简单的GET请求程序
6 回答