-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathimplicit.js
More file actions
28 lines (23 loc) · 860 Bytes
/
implicit.js
File metadata and controls
28 lines (23 loc) · 860 Bytes
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
/*
* Copyright 2013-2017 ForgeRock AS. All Rights Reserved
*
* Use of this code requires a commercial software license with ForgeRock AS.
* or with one of its affiliates. All use shall be exclusively subject
* to such license between the licensee and ForgeRock AS.
*/
// START CONFIGURATION...
// client_secret is not used in the implicit profile
var redirect_uri = server + openid + "/cb-implicit.html";
var state = "af0ifjsldkj";
var nonce = "n-0S6_WzA2Mj";
// ...END CONFIGURATION
/* Returns a map of parameters present in the document fragment. */
function getParamsFromFragment() {
var params = {};
var postBody = location.hash.substring(1);
var regex = /([^&=]+)=([^&]*)/g, m;
while (m = regex.exec(postBody)) {
params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}
return params;
}