-
Notifications
You must be signed in to change notification settings - Fork 97
/
info.ejs
35 lines (35 loc) · 1001 Bytes
/
info.ejs
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
<!DOCTYPE html>
<script type="text/javascript">
document.write("\<script src='//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' type='text/javascript'>\<\/script>");
</script>
<p>
Your access token (Authorization Bearer) is:
<pre><%= access_token %></pre>
Your refresh token is:
<pre><%= refresh_token %></pre>
</p>
<p>
<div id="div1"><h2>Get User Information from access token</h2></div>
<button id="button_1">Get Protected EndPoint Data</button>
</p>
<p>
<div id="protectedEndPointData">No Protected EndPoint Data yet</div>
</p>
<script>
$(document).ready(function () {
$("#button_1").click(function () {
$.ajax({
headers: {
"Authorization": "Bearer <%= access_token %>"
},
url: "/api/protectedEndPoint",
success: function (result) {
$("#protectedEndPointData").html(result);
},
failure: function (result) {
$("#protectedEndPointData").html(result);
}
});
});
});
</script>