-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimplicit.js
34 lines (29 loc) · 1.04 KB
/
implicit.js
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
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If applicable, add the following below this MPL 2.0 HEADER, replacing
* the fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* Copyright 2013-2014 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;
}