<!DOCTYPE html>
<html lang="en">
<head>
<title>Start Page</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
</head>
<body>
<h1> Start the authentication process </h1>
<button type="submit" id="start-auth"> Start </button>
<script type="text/javascript">
$(function() {
var url = "https://{{p4oAuthHostname}}:{{p4oAuthPort}}/p4fetch?response_type=code&client_id={{login}}&redirect_uri=" + encodeURIComponent("{{redirectUri}}");
$("#start-auth").click(function() {
var params = paramObj();
url += "&access_token=" + params.access_token;
$.ajax({
type: "GET",
});
});
function paramObj() {
var searchStr = window.location.search;
if (!searchStr)
return;
if ( searchStr.indexOf("?") === 0 )
searchStr = searchStr.substring(1);
var obj = {};
if ( searchStr.length > 0) {
var splits = searchStr.split("&");
for (var idx = 0; idx < splits.length; ++idx) {
var kvArr = splits[idx].split("=");
obj[decodeURIComponent(kvArr[0])] =
decodeURIComponent(kvArr[1]);
}
}
return obj;
}
});
</script>
</body>
</html>
# |
Change |
User |
Description |
Committed |
|
#2
|
9182 |
tjuricek |
0.1.2 Added a password grant workflow |
|
|
#1
|
9181 |
tjuricek |
Updating documentation |
|
|