Skip to content

Commit ee8f5dc

Browse files
authored
add sso loing docs (#170)
* add sso-login * fix sso goole * fix sso * fix sso_github * fix sso error docs * add ali-open Docs highlighting
1 parent a671ae9 commit ee8f5dc

File tree

17 files changed

+429
-155
lines changed

17 files changed

+429
-155
lines changed
96.5 KB
Loading
115 KB
Loading
118 KB
Loading
127 KB
Loading
10.8 KB
Loading

docs/faq/why.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ If you see this error when adding storage, but you don't see the corresponding d
4444
In particular, for Safari:
4545

4646
- For cross-origin media, content-type must be the media type, not the generic application/octet-stream. So if the content-type returned by the direct link is application/octet-stream, then Safari will not be able to play.(PS: Why Can AliyunDrive play in Safari? Because the official website of the video playback is not the use of download links, but after the transcoding of AliyunDrive)
47+
- Aliyun disk development platform driver supports online video playback (also limited to Aliyun disk open platform driver and **Aliyun Video Previewer** option player)
4748

4849
### Why can't I preview the office file?
4950

@@ -241,3 +242,11 @@ Workaround:
241242

242243

243244
**Method 2**: Turn off and disable IPv6 of vps
245+
246+
### 123 When the cloud disk is mounted, json: cannot unmarshal string into Go struct field TokenResp.data of type struct { Token string "json:\"token\"" }
247+
248+
![faq](/img/faq/123error.png)
249+
250+
There is a high probability that your device that builds Alist is temporarily blocked, frozen, blocked, or restricted. Don't mount it yet, wait a few hours and try again or wait a day
251+
252+
(Conclusions from the above questions have been tested)

docs/guide/advanced/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ dir:
1919

2020
- [**Search how to use tutorials and precautions**](search.md)
2121

22-
- [**GitHub Login**](github.md)
22+
- [**Single Sign-On**](sso.md)
2323

2424
- [**offline-download**](offline-download.md)
25-
26-

docs/guide/advanced/github.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

docs/guide/advanced/offline-download.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ According to [source code] (https://github.com/alist-org/alist/blob/main/interna
6666
- ```{ *** Value: "http://admin:adminadmin@localhost:8080/", Type: conf.TypeString, *** } ```
6767

6868

69-
3. We can also customize, instead of using the default presets
69+
3. ==We can also customize, instead of using the default presets==
7070
- Modification location: **Alist Manage** --> **Settings** --> **Qbittorrent url** option, just follow the modification
7171

7272

@@ -97,4 +97,4 @@ The above two methods are most likely caused by the qBittorrent software itself,
9797
poster="/img/advanced/qbittorrent.png"
9898
/>
9999

100-
**If the video fails, you can watch it here: no yet**
100+
**If the video fails, you can watch it here: https://b23.tv/J34qDiG**

docs/guide/advanced/sso.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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+
![sso](/img/advanced/github.png)
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+
![sso](/img/advanced/dingding.png)
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+
![sso](/img/advanced/weiruan.png)
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+
![Google](/img/drivers/google/Google-6.png)
198+
199+
### Completely fill in the reference schematic
200+
201+
![sso](/img/advanced/google.png)
202+
203+
::::

0 commit comments

Comments
 (0)