本教程以GitHub登录为例,其他社交登录以此类推即可。 ### 到GitHub申请client 打开:[https://github.com/settings/developers,点击new](https://github.com/settings/developers)点击 newOAuth app: ![](https://img.kancloud.cn/8b/03/8b03e3d4e245338377743ce6197e7192_2808x1300.png) 填写以下信息 可以本地地址进行开发 ![](https://img.kancloud.cn/6b/cc/6bcce84074704089773e89e18624a553_2814x1608.png) 填写好后,点击Register application即可。申请好后,可以看到client id和client secret: ![](https://img.kancloud.cn/30/62/306218cbb5ce50e9934268859f465672_2772x1582.png) ### 3.到配置文件添加配置: ![](https://img.kancloud.cn/00/ca/00cabc4b7e206a59ab6c8c3e0239e19f_2826x1132.png) 修改好后启动pre即可 规则: 1.一个社交帐户只能绑定一个系统用户; 2.一个系统账户可以绑定多个同类型的社交账号。 ### 4.其他社交账client id、client secret申请地址: QQ:[https://connect.qq.com/manage.html](https://connect.qq.com/manage.html),比较麻烦,需要有已经备案的服务器和域名。 Gitee:[https://gitee.com/oauth/applications](https://gitee.com/oauth/applications),简单,申请过程和github类似。 钉钉:[https://open-dev.dingtalk.com/#/loginMan ](https://open-dev.dingtalk.com/#/loginMan) 腾讯云:[https://dev.tencent.com/user/account/setting/applications](https://dev.tencent.com/user/account/setting/applications),实际上就是coding,过程也较简单; 微软:[https://dev.tencent.com/user/account/setting/applications](https://dev.tencent.com/user/account/setting/applications),回调地址必须是https的,所以本地没办法模拟。