-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewDevToken
More file actions
21 lines (17 loc) · 768 Bytes
/
newDevToken
File metadata and controls
21 lines (17 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
javascript:
function run() {
let data = "client_id=skydentity-password-grant-client&client_secret=skydentity-api-secret&grant_type=password&scope=openid%20skydentity%20profile&username=validuser@example.com&password=valid_password";
let xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
let data = JSON.parse(this.responseText);
localStorage.setItem("Authorization", data.access_token);
document.location.reload(true);
}
});
xhr.open("POST", "https://skydentityapi-dev.agvancesky.com/connect/token");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);
}
run();