Include redirect_uri in access token request for OAuth2 authentication.

This commit is contained in:
Stefano Travelli
2015-02-10 14:43:51 +01:00
parent 61a87b8fd7
commit b975d4fee8

View File

@@ -4,6 +4,7 @@ var popupDialog;
var clientId; var clientId;
var realm; var realm;
var oauth2KeyName; var oauth2KeyName;
var redirect_uri;
function handleLogin() { function handleLogin() {
var scopes = []; var scopes = [];
@@ -141,6 +142,8 @@ function handleLogin() {
window.enabledScopes=scopes; window.enabledScopes=scopes;
redirect_uri = redirectUrl;
url += '&redirect_uri=' + encodeURIComponent(redirectUrl); url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
url += '&realm=' + encodeURIComponent(realm); url += '&realm=' + encodeURIComponent(realm);
url += '&client_id=' + encodeURIComponent(clientId); url += '&client_id=' + encodeURIComponent(clientId);
@@ -199,7 +202,8 @@ function processOAuthCode(data) {
var params = { var params = {
'client_id': clientId, 'client_id': clientId,
'code': data.code, 'code': data.code,
'grant_type': 'authorization_code' 'grant_type': 'authorization_code',
'redirect_uri': redirect_uri
} }
$.ajax( $.ajax(
{ {