forked from zy6668/GetAutoApiToken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (39 loc) · 2.72 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<body>
<! --修改地方1-->
<p>已更新</p>
<div>
<div>
<! --修改地方2-->
<a
href='https://login.microsoftonline.com/common/oauth2/v2.0/authorize?scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite.All+Files.Read.All+Sites.Read.All+Sites.ReadWrite.All+User.Read.All+User.ReadWrite.All+Directory.Read.All+Directory.ReadWrite.All+Mail.Read+Mail.ReadWrite+MailboxSettings.Read+MailboxSettings.ReadWrite+offline_access&response_type=code&client_id=354df77a-ee09-446c-b36d-44b66d3998c9&redirect_uri=https://yjf2301.github.io/GetAutoApiToken/'>click
here to get your refresh code</a>
</div>
<div id='info'></div>
<form action="https://login.microsoftonline.com/common/oauth2/v2.0/token" method="POST" style="display:none;">
<! --修改地方3-->
<input type="text" name="client_id" placeholder="client_id" value="354df77a-ee09-446c-b36d-44b66d3998c9" />
<! --修改地方4-->
<input type="text" name="client_secret" placeholder="client_secret"
value="A-qk-432pXe.jFG7P3sE-eL1.Ou53RlbwR" />
<input type="text" name="grant_type" placeholder="authorization_code" value="authorization_code" />
<input type="text" name="requested_token_use" placeholder="on_behalf_of" value="on_behalf_of" />
<! --修改地方5-->
<input type="text" name="redirect_uri" placeholder="redirect_uri"
value="https://yjf2301.github.io/GetAutoApiToken/" />
<input type="text" name="code" placeholder="code" id="code" />
<input type="submit" id='submit' />
</form>
<script>
//https://api.moeclub.org/onedrive-login?error=access_denied&error_description=AADSTS650051%3a+Using+application+%27OneDrive+for+API%27+is+currently+not+supported+for+your+organization+whu.edu.cn+because+it+is+in+an+unmanaged+state.+An+administrator+needs+to+claim+ownership+of+the+company+by+DNS+validation+of+whu.edu.cn+before+the+application+OneDrive+for+API+can+be+provisioned.%0d%0aTrace+ID%3a+03c26bfa-d4e7-4c28-bf15-fd39e4921900%0d%0aCorrelation+ID%3a+3233c0aa-7100-44bd-99f4-309c8e6288e5Timestamp%3a+2020-01-08+07%3a31%3a26Z
let url = new URL(window.location.href);
if (url.searchParams.get('code')) {
document.getElementById('code').value = url.searchParams.get('code');
document.getElementById('submit').click();
} else if (url.searchParams.get('error')) {
document.getElementById('info').innerText = url.searchParams.get('error') + ":\n" + url.searchParams
.get('error_description');
}
</script>
</body>
</html>