|
| 1 | +### 3.4. Google { lang="en" } |
| 2 | + |
| 3 | +### 3.4. 谷歌 { lang="zh-CN" } |
| 4 | + |
| 5 | +::: en |
| 6 | +::: warning |
| 7 | +If you want to use Google to log in, you first need the machine you built OpenList to be able to connect to Google before you can call and use it, otherwise you cannot use it if the link is not connected |
| 8 | +::: |
| 9 | + |
| 10 | +::: en |
| 11 | + |
| 12 | +1. First open **https://console.cloud.google.com/projectselector2/apis/dashboard?hl=zh-cn** |
| 13 | +2. If you are using it for the first time, you need to create a new project first (just write whatever you want, skip it if it has already been created) |
| 14 | +3. Then configure the [consent screen](#agree-to-screen-configuration) (there is a separate instruction on how to configure the document, if it is already configured, skip it) |
| 15 | +4. After configuring the unified screen, we click the credentials on the left, create credentials, and select OAuth client ID |
| 16 | + |
| 17 | +- Application Type Select Web Application, and write the name as you like |
| 18 | +- Then add our two callback parameters in the authorized redirect URI |
| 19 | + |
| 20 | +```bash title="Callback" parameter example |
| 21 | +http://127.0.0.1:5244/api/auth/sso_callback?method=get_sso_id |
| 22 | +http://127.0.0.1:5244/api/auth/sso_callback?method=sso_get_token |
| 23 | +``` |
| 24 | + |
| 25 | +- Write **http(s):\//your own domain name/api/auth/sso_callback?method=get_sso_id** when filling in and using it by yourself |
| 26 | +- Write **http(s):\//your own domain name/api/auth/sso_callback?method=sso_get_token** when filling in and using it by yourself |
| 27 | + After filling it out, click Create to get the OAuth client ID and secret key |
| 28 | +- (It doesn't matter if you accidentally close it here, just click on the name of the application we created and enter it in the upper right position to see it) |
| 29 | + We have got the client ID and secret key and fill them in the OpenList single sign-on configuration. |
| 30 | + Remember to write and save the background parameters of OpenList. After writing and saving, you have to go back to the bottom of the personal data and there will be a button that needs to be bound, otherwise it cannot be used |
| 31 | + |
| 32 | +::: |
| 33 | + |
| 34 | +::: zh-CN |
| 35 | +::: warning |
| 36 | +若想使用Google登录,首选需要你搭建OpenList的机器能连接访问Google才可以调用使用,不然连接不上无法使用 |
| 37 | +::: |
| 38 | +::: zh-CN |
| 39 | + |
| 40 | +1. 首先打开 **https://console.cloud.google.com/projectselector2/apis/dashboard?hl=zh-cn** |
| 41 | +2. 如果是第一次使用需要先新建一个项目(随便写就行,如果已创建跳过) |
| 42 | +3. 然后配置[同意屏幕](#同意屏幕配置)(如何配置文档中有单独说明,如果已经配置好跳过) |
| 43 | +4. 配置好统一屏幕后我们点左侧的凭据,创建凭据,选择OAuth 客户端ID |
| 44 | + |
| 45 | +- 应用类型 选择 Web 应用,名称随便写 |
| 46 | +- 然后在 已获授权的重定向 URI 添加我们的两个回调参数 |
| 47 | + |
| 48 | +```bash title="回调参数示例" |
| 49 | +http://127.0.0.1:5244/api/auth/sso_callback?method=get_sso_id |
| 50 | +http://127.0.0.1:5244/api/auth/sso_callback?method=sso_get_token |
| 51 | +``` |
| 52 | + |
| 53 | +- 大家使用的时候写 **http(s):\//自己域名/api/auth/sso_callback?method=get_sso_id** |
| 54 | +- 大家使用的时候写 **http(s):\//自己域名/api/auth/sso_callback?method=sso_get_token** |
| 55 | + 填写好后,点击创建就能拿到 OAuth的客户端ID和秘钥 |
| 56 | +- (在这里如果你不小心关闭了也没关系,点击我们创建的应用名称进去在右上的位置就能看到) |
| 57 | + 客户端ID和秘钥我们都拿到了填写到OpenList单点登录配置里面去即可 |
| 58 | + OpenList 后台参数也记得写好保存,写好保存后也要回到个人资料下方会有一个需要绑定的按钮进行绑定,否则无法使用 |
| 59 | + |
| 60 | +::: |
| 61 | + |
| 62 | +#### 3.4.1. Agree to screen configuration { lang="en" } |
| 63 | + |
| 64 | +#### 3.4.1. 同意屏幕配置 { lang="zh-CN" } |
| 65 | + |
| 66 | +::: en |
| 67 | +If it has been configured, just ignore this picture (you can zoom in if you can’t see it clearly) |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +::: |
| 72 | +::: zh-CN |
| 73 | +如已配置好 忽略本图即可(如果看不清楚可以放大) |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +::: |
| 78 | + |
| 79 | +#### 3.4.2. Completely fill in the reference schematic { lang="en" } |
| 80 | + |
| 81 | +#### 3.4.2. 完整填写参考示意图 { lang="zh-CN" } |
| 82 | + |
| 83 | +::: en |
| 84 | + |
| 85 | +::: |
| 86 | +::: zh-CN |
| 87 | + |
| 88 | +::: |
0 commit comments