问题标签 [github-oauth]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
30 浏览

spring-boot - 重定向 URI 采用上游变量名称并给出 redirect_uri_mismatch]

当我在 url github oauth 登录后点击本地 https://localhost:7083/lsso-client 时,我会遇到此错误

[redirect_uri_mismatch] redirect_uri 必须与此应用程序的注册回调 URL 匹配。应用程序点击网址:https ://github.com/login/oauth/authorize?response_type=code&client_id=1de6e5ce9a61fc3d5c1a&scope=read:user&state=M9SkDJq6Jrb07zwBF6aQLpmYN9QGRwpHfNScpLOWoKM%3D&redirect_uri=**http://servers**/lsso-client/login/oauth2/代码/github URL:https://localhost:7083/lsso-client/login/oauth2/code/github?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application .&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=M9SkDJq6Jrb07zwBF6aQLpmYN9QGRwpHfNScpLOWoKM%3D

URL 中的粗体区域应为 https://localhost:7083,但它仅采用上游变量名称。我正在使用springboot> 2。

0 投票
0 回答
9 浏览

github - 我需要从 GitHub 获取哪些详细信息来使用 oauth 对用户进行身份验证?

我正在尝试使用 GitHub oauth 构建一个 oauth 应用程序,现在我不清楚我应该从 GitHub 获取哪些详细信息来验证用户。例如,我无法使用用户名进行验证,因为它不是只读的,那么我该怎么做呢?

这是我计划的流程,

  1. 使用 JS,CLIENT_ID 从客户端从 GitHub 获取临时代码
  2. 将代码传递给服务器以使用 CLIENT_ID 和 CLIENT_SECRET 交换令牌
  3. 获取用户详细信息并将其存储在数据库中以供进一步访问
  4. 将令牌发送回客户端以将其存储在会话或本地存储中

现在这是我的问题,

  1. 流量好不好?
  2. 我应该从 GitHub 获取哪些详细信息来存储它的 id 数据库以供进一步访问?