diff --git a/dist/index.html b/dist/index.html
index 3e47f2b8..d2577335 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -51,7 +51,8 @@
clientSecret: "your-client-secret",
realm: "your-realms",
appName: "your-app-name",
- scopeSeparator: ","
+ scopeSeparator: ",",
+ additionalQueryStringParams: {}
});
}
diff --git a/dist/lib/swagger-oauth.js b/dist/lib/swagger-oauth.js
index 3bb1c277..9a1030ac 100644
--- a/dist/lib/swagger-oauth.js
+++ b/dist/lib/swagger-oauth.js
@@ -7,6 +7,7 @@ var oauth2KeyName;
var redirect_uri;
var clientSecret;
var scopeSeparator;
+var additionalQueryStringParams;
function handleLogin() {
var scopes = [];
@@ -156,6 +157,9 @@ function handleLogin() {
url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state);
+ for (var key in additionalQueryStringParams) {
+ url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
+ }
window.open(url);
});
@@ -190,6 +194,7 @@ function initOAuth(opts) {
clientSecret = (o.clientSecret||errors.push('missing client secret'));
realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' ');
+ additionalQueryStringParams = (o.additionalQueryStringParams||{});
if(errors.length > 0){
log('auth unable initialize oauth: ' + errors);
diff --git a/lib/swagger-oauth.js b/lib/swagger-oauth.js
index 3bb1c277..9a1030ac 100644
--- a/lib/swagger-oauth.js
+++ b/lib/swagger-oauth.js
@@ -7,6 +7,7 @@ var oauth2KeyName;
var redirect_uri;
var clientSecret;
var scopeSeparator;
+var additionalQueryStringParams;
function handleLogin() {
var scopes = [];
@@ -156,6 +157,9 @@ function handleLogin() {
url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state);
+ for (var key in additionalQueryStringParams) {
+ url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
+ }
window.open(url);
});
@@ -190,6 +194,7 @@ function initOAuth(opts) {
clientSecret = (o.clientSecret||errors.push('missing client secret'));
realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' ');
+ additionalQueryStringParams = (o.additionalQueryStringParams||{});
if(errors.length > 0){
log('auth unable initialize oauth: ' + errors);
diff --git a/src/main/html/index.html b/src/main/html/index.html
index 3e47f2b8..d2577335 100644
--- a/src/main/html/index.html
+++ b/src/main/html/index.html
@@ -51,7 +51,8 @@
clientSecret: "your-client-secret",
realm: "your-realms",
appName: "your-app-name",
- scopeSeparator: ","
+ scopeSeparator: ",",
+ additionalQueryStringParams: {}
});
}