|
|
@@ -5,6 +5,7 @@ var clientId; |
|
|
|
var realm; |
|
|
|
var oauth2KeyName; |
|
|
|
var redirect_uri; |
|
|
|
var scopeSeparator; |
|
|
|
|
|
|
|
function handleLogin() { |
|
|
|
var scopes = []; |
|
|
@@ -151,7 +152,7 @@ function handleLogin() { |
|
|
|
url += '&redirect_uri=' + encodeURIComponent(redirectUrl); |
|
|
|
url += '&realm=' + encodeURIComponent(realm); |
|
|
|
url += '&client_id=' + encodeURIComponent(clientId); |
|
|
|
url += '&scope=' + encodeURIComponent(scopes.join(' ')); |
|
|
|
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator)); |
|
|
|
url += '&state=' + encodeURIComponent(state); |
|
|
|
|
|
|
|
window.open(url); |
|
|
@@ -185,6 +186,7 @@ function initOAuth(opts) { |
|
|
|
popupDialog = (o.popupDialog||$('.api-popup-dialog')); |
|
|
|
clientId = (o.clientId||errors.push('missing client id')); |
|
|
|
realm = (o.realm||errors.push('missing realm')); |
|
|
|
scopeSeparator = (o.scopeSeparator||' '); |
|
|
|
|
|
|
|
if(errors.length > 0){ |
|
|
|
log('auth unable initialize oauth: ' + errors); |
|
|
|