|
| 1 | +--- |
| 2 | +# This is the icon of the page |
| 3 | +icon: group |
| 4 | +# This control sidebar order |
| 5 | +order: 9 |
| 6 | +# A page can have multiple categories |
| 7 | +category: |
| 8 | + - Guide |
| 9 | +# A page can have multiple tags |
| 10 | +tag: |
| 11 | + - Advanced |
| 12 | + - Guide |
| 13 | +# this page is sticky in article list |
| 14 | +sticky: true |
| 15 | +# this page will appear in starred articles |
| 16 | +star: true |
| 17 | +--- |
| 18 | + |
| 19 | +# Third-party single sign-on |
| 20 | +### Single sign-on client id |
| 21 | + |
| 22 | +client ID |
| 23 | + |
| 24 | +### Single sign-on client secrets |
| 25 | + |
| 26 | +secrets ID |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +::: warning matters needing attention |
| 31 | + |
| 32 | +1. Remember to write and save the background parameters of AList. 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 |
| 33 | + |
| 34 | +2. Only one of the four types of single sign-on can be enabled temporarily. If you used other single sign-on methods before and then changed to a new single Unbind (just one click) and then bind the single sign-on method you want to use now. |
| 35 | + |
| 36 | +::: |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +::::tabs#sso |
| 41 | + |
| 42 | +@tab GitHub |
| 43 | + |
| 44 | +::: warning |
| 45 | +If you want to use GitHub to log in, you first need the machine you built Alist to be able to connect to GitHub before you can call and use it, otherwise you cannot use it if the link is not connected |
| 46 | +::: |
| 47 | + |
| 48 | +Open **https://github.com/settings/developers** Click **`New OAuth App`** |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +### Register OAuth Instructions |
| 53 | + |
| 54 | +- Application name |
| 55 | + - Write whatever you want to call it |
| 56 | +- ==**Homepage URL**== |
| 57 | + - home URL address |
| 58 | + - Both **http** and **https** can be used |
| 59 | +- Application description |
| 60 | + - write whatever you want |
| 61 | +- ==**Authorization callback URL**== |
| 62 | + - Callback URL address |
| 63 | + - **https://your_domain/api/auth/sso_callback** |
| 64 | + - Both **http** and **https** can be used |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +Remember to get **Client secrets** after filling it out, and then fill it in the Alist background. |
| 69 | + |
| 70 | +Remember to write and save the background parameters of AList. 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 |
| 71 | + |
| 72 | +### Completely fill in the reference schematic |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +### GitHub login Video Tutorials |
| 79 | + |
| 80 | +<ArtPlayer |
| 81 | + src="https://hub.onmicrosoft.cn/public/video/weibo?uid=7821998556&cursor=4872400300415846&raw=true" |
| 82 | + poster="/img/advanced/github-login.png" |
| 83 | +/> |
| 84 | + |
| 85 | +**If the video fails, you can watch it here: https://b23.tv/Fm8AkC5** |
| 86 | + |
| 87 | +@tab Dingtalk |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +First open **https://open-dev.dingtalk.com/fe/app#/corp/app** |
| 92 | + |
| 93 | +In the upper right corner, first select `New Application`, select `H5 Micro Application` as the type, fill in the content by yourself and click Confirm to create |
| 94 | + |
| 95 | +Click on the new application and we will see the application credentials option, where `AppKey` is the client ID, and `AppSecret` is the client secret key |
| 96 | + |
| 97 | +- Just fill in the corresponding parameters in the Alist background single sign-on |
| 98 | + |
| 99 | +Go to the left column and find `Login and Share` == Fill in the callback parameters **`http://127.0.0.1:5234/api/auth/sso_callback`**== |
| 100 | + |
| 101 | +```Callback parameter example |
| 102 | +http://127.0.0.1:5244/api/auth/sso_callback |
| 103 | +``` |
| 104 | + |
| 105 | +- Note: I used the callback parameter here for local testing. http://127.x When you use it, Write **http(s)://your own domain name/api/auth/sso_callback** when filling in and using it by yourself |
| 106 | + |
| 107 | +Write the callback parameters well. Let’s go to the left column and find `Privilege Management`, find **`Personal Information Read Permission of Address Book`** and click to authorize |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +Remember to write and save the background parameters of AList. 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 |
| 112 | + |
| 113 | +### Completely fill in the reference schematic |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +@tab Microsoft |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +First open **https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade** |
| 124 | + |
| 125 | +Then register to create an application, I won't say much here, you can see the complete schematic diagram |
| 126 | + |
| 127 | +Account type must be selected: **Account in any organizational directory (any Azure AD directory - multi-tenant)** |
| 128 | + |
| 129 | +Microsoft callback parameters: must start with "HTTPS" or "http://localhost (I used localhost here for local testing) |
| 130 | + |
| 131 | +```Callback parameter example |
| 132 | +http://localhost:5244/api/auth/sso_callback?method=sso_get_token |
| 133 | +http://localhost:5244/api/auth/sso_callback?method=get_sso_id |
| 134 | +``` |
| 135 | + |
| 136 | +- Write **http(s)://your own domain name/api/auth/sso_callback?method=sso_get_token** when filling in and using it by yourself |
| 137 | +- Write **http(s)://your own domain name/api/auth/sso_callback?method=get_sso_id** when filling in and using it by yourself |
| 138 | +- Note: When adding a redirect URL to a new application, only one can be added. After the application is registered and registered, click on the application to see the options behind the redirect URI |
| 139 | + |
| 140 | +After filling it out, we click `Certificate and Password` on the left column to create a new `Client Password` to get our client secret key |
| 141 | + |
| 142 | +- After the client password is created, the **`value`** parameter is our `client key`, remember to save it, it will not appear again if it appears once, if you don’t save it in time, just create a new client password |
| 143 | + |
| 144 | +The client ID is in `Overview` at the top of the left column, find the application (client) ID, which is the client ID we need to fill in the Alist |
| 145 | + |
| 146 | +- We have got the client ID and secret key and fill them in the AList single sign-on configuration. |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +Remember to write and save the background parameters of AList. 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 |
| 151 | + |
| 152 | +### Completely fill in the reference schematic |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +@tab Google |
| 159 | + |
| 160 | +::: warning |
| 161 | +If you want to use Google to log in, you first need the machine you built Alist 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 |
| 162 | +::: |
| 163 | + |
| 164 | +1. First open **https://console.cloud.google.com/projectselector2/apis/dashboard?hl=zh-cn** |
| 165 | + |
| 166 | +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) |
| 167 | + |
| 168 | +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) |
| 169 | + |
| 170 | +4. After configuring the unified screen, we click the credentials on the left, create credentials, and select OAuth client ID |
| 171 | + |
| 172 | +- Application Type Select Web Application, and write the name as you like |
| 173 | +- Then add our two callback parameters in the authorized redirect URI |
| 174 | + |
| 175 | +```Callback parameter example |
| 176 | +http://127.0.0.1:5244/api/auth/sso_callback?method=get_sso_id |
| 177 | +http://127.0.0.1:5244/api/auth/sso_callback?method=sso_get_token |
| 178 | +``` |
| 179 | + |
| 180 | +- Write **http(s)://your own domain name/api/auth/sso_callback?method=get_sso_id** when filling in and using it by yourself |
| 181 | +- Write **http(s)://your own domain name/api/auth/sso_callback?method=sso_get_token** when filling in and using it by yourself |
| 182 | + |
| 183 | +After filling it out, click Create to get the OAuth client ID and secret key |
| 184 | + |
| 185 | +- (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) |
| 186 | + |
| 187 | +We have got the client ID and secret key and fill them in the AList single sign-on configuration. |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | +Remember to write and save the background parameters of AList. 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 |
| 192 | + |
| 193 | +#### Agree to screen configuration |
| 194 | + |
| 195 | +If it has been configured, just ignore this picture (you can zoom in if you can’t see it clearly) |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | +### Completely fill in the reference schematic |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | +:::: |
0 commit comments