oauth2-client-demo/index.html
Yann Esposito (Yogsototh) 0f15c8f4a6
easier to configure version
2018-04-16 16:09:37 +02:00

40 lines
1.5 KiB
HTML

<html>
<head>
<title>Authorize an App</title>
<link rel="stylesheet" href="brutalist.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="./infos.js"></script>
<script>
var displayAuthUrl=oauthServerUrl + "?\n\t"
+ "response_type=" + encodeURIComponent(response_type) + "\n\t"
+ "&client_id=" + encodeURIComponent(client_id) + "\n\t"
+ "&redirect_uri=" + encodeURIComponent(redirect_uri) + "\n\t"
+ "&scope=" + encodeURIComponent(scope) + "\n\t"
+ "&state=" + encodeURIComponent(state);
var authUrl=displayAuthUrl.replace("\n","");
</script>
</head>
<body>
<h1>OAuth2 Client Demo App</h1>
<p>The only thing needed to ask an user to grants the Yolo app
access to Visibility is just putting a simple link:</p>
<p>Here the button is a link to:</p>
<pre id="displayUrlPre"></pre>
<a id="authURLLink" href="#">click Here</a>
to authorize me with the <strong>scopes</strong>:
<ul id="scopes"></ul>
<script>
$.when( $.ready ).then(function () {
$("#displayUrlPre").html(displayAuthUrl);
$("#authURLLink").attr("href",displayAuthUrl);
$.each(scopes,function(i,scope){
$("#scopes").append("<li>"+scope+"</li>\n");
})
});
</script>
</body>
</html>