Adding (ignored) oauth2 state parameter.

This commit is contained in:
Thijs Van der Schaeghe
2015-02-14 14:34:39 +01:00
parent 34787348a9
commit 9c6582455e
4 changed files with 347 additions and 339 deletions

View File

@@ -140,6 +140,9 @@ function handleLogin() {
scopes.push(scope);
}
// Implicit auth recommends a state parameter.
var state = Math.random ();
window.enabledScopes=scopes;
redirect_uri = redirectUrl;
@@ -148,6 +151,7 @@ function handleLogin() {
url += '&realm=' + encodeURIComponent(realm);
url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes);
url += '&state=' + encodeURIComponent(state);
window.open(url);
});