oauth2入门github


参考:https://www.ruanyifeng.com/blog/2019/04/github-oauth.html

https://blog.csdn.net/Lee_01/article/details/103691864

1.获取GitHub 客户端 ID(client ID)和客户端密钥(client secret)

访问这个网址,填写登记表。

2.配置项目 参考 https://blog.csdn.net/Lee_01/article/details/103691864

3.大概流程:

  1.请求授权地址

https://github.com/login/oauth/authorize?client_id=7e015d8ce32370079895&redirect_uri=http://localhost:8080/oauth/redirect

  2.用户点击确认授权

  3.回调本地

  http://localhost:8080/oauth/redirect?code=859310e7cecc9196f4af