File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 5151 clientSecret : "your-client-secret-if-required" ,
5252 realm : "your-realms" ,
5353 appName : "your-app-name" ,
54- scopeSeparator : ","
54+ scopeSeparator : "," ,
55+ additionalQueryStringParams : { }
5556 } ) ;
5657 }
5758
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var oauth2KeyName;
77var redirect_uri ;
88var clientSecret ;
99var scopeSeparator ;
10+ var additionalQueryStringParams ;
1011
1112function handleLogin ( ) {
1213 var scopes = [ ] ;
@@ -156,6 +157,9 @@ function handleLogin() {
156157 url += '&client_id=' + encodeURIComponent ( clientId ) ;
157158 url += '&scope=' + encodeURIComponent ( scopes . join ( scopeSeparator ) ) ;
158159 url += '&state=' + encodeURIComponent ( state ) ;
160+ for ( var key in additionalQueryStringParams ) {
161+ url += '&' + key + '=' + encodeURIComponent ( additionalQueryStringParams [ key ] ) ;
162+ }
159163
160164 window . open ( url ) ;
161165 } ) ;
@@ -190,6 +194,7 @@ function initOAuth(opts) {
190194 clientSecret = ( o . clientSecret || null ) ;
191195 realm = ( o . realm || errors . push ( 'missing realm' ) ) ;
192196 scopeSeparator = ( o . scopeSeparator || ' ' ) ;
197+ additionalQueryStringParams = ( o . additionalQueryStringParams || { } ) ;
193198
194199 if ( errors . length > 0 ) {
195200 log ( 'auth unable initialize oauth: ' + errors ) ;
You can’t perform that action at this time.
0 commit comments