Skip to content

Commit 5195447

Browse files
committed
Merge pull request #1419 from lucian303/oauth-client-secret
Add support for oauth client secret when calling the token URL. Fixes #1384. Fixes #1324.
2 parents f0e7de2 + 1fd15c6 commit 5195447

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/swagger-oauth.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var clientId;
55
var realm;
66
var oauth2KeyName;
77
var redirect_uri;
8+
var clientSecret;
89

910
function handleLogin() {
1011
var scopes = [];
@@ -185,6 +186,7 @@ function initOAuth(opts) {
185186
popupMask = (o.popupMask||$('#api-common-mask'));
186187
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
187188
clientId = (o.clientId||errors.push('missing client id'));
189+
clientSecret = (o.clientSecret||errors.push('missing client secret'));
188190
realm = (o.realm||errors.push('missing realm'));
189191

190192
if(errors.length > 0){
@@ -207,6 +209,7 @@ function initOAuth(opts) {
207209
window.processOAuthCode = function processOAuthCode(data) {
208210
var params = {
209211
'client_id': clientId,
212+
'client_secret': clientSecret,
210213
'code': data.code,
211214
'grant_type': 'authorization_code',
212215
'redirect_uri': redirect_uri

src/main/html/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
if(typeof initOAuth == "function") {
4848
initOAuth({
4949
clientId: "your-client-id",
50+
clientSecret: "your-client-secret",
5051
realm: "your-realms",
5152
appName: "your-app-name"
5253
});

0 commit comments

Comments
 (0)