forked from gabrielsroka/gabrielsroka.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsessions-me.htm
32 lines (32 loc) · 920 Bytes
/
sessions-me.htm
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
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sessions - Me</title>
<link href="https://ok1static.oktacdn.com/assets/css/enduser/enduser.css" type="text/css" rel="stylesheet" />
</head>
<body>
<br>
<nav>
<a id="home"><span class="inline-icon icon-home-light"></span><span>Home</span></a> -
<a href="/login.htm?signout">Sign out</a>
<br>
</nav>
<br>
<main>
<div id="app"></div>
</main>
<script>
var baseUrl = "https://gsroka-neto.oktapreview.com";
// For this to work, enable CORS in Okta: Security > API > Trusted Origins > Add Origin > CORS.
var request = new XMLHttpRequest();
request.open('GET', baseUrl + '/api/v1/sessions/me');
request.withCredentials = true;
request.onload = function () {
app.innerHTML = "<pre>" + JSON.stringify(JSON.parse(this.responseText), null, 4) + "</pre>";
};
request.send();
home.href = baseUrl;
</script>
</body>
</html>