Skip to content

Commit 49705f3

Browse files
authored
Merge pull request #3155 from bodnia/fix-3128
fix #3128
2 parents 88df655 + 5f2eaff commit 49705f3

File tree

8 files changed

+72
-71
lines changed

8 files changed

+72
-71
lines changed

dist/swagger-ui-bundle.js

Lines changed: 47 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/plugins/auth/actions.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const authorizePassword = ( auth ) => ( { authActions } ) => {
8181
if ( passwordType === "basic") {
8282
headers.Authorization = "Basic " + btoa(username + ":" + password)
8383
} else {
84-
Object.assign(form, {username}, {password})
84+
Object.assign(form, {username}, {password})
8585

8686
if ( passwordType === "query") {
8787
if ( clientId ) {
@@ -91,7 +91,7 @@ export const authorizePassword = ( auth ) => ( { authActions } ) => {
9191
query.client_secret = clientSecret
9292
}
9393
} else {
94-
Object.assign(form, {client_id: clientId}, {client_secret: clientSecret})
94+
headers.Authorization = "Basic " + btoa(clientId + ":" + clientSecret)
9595
}
9696
}
9797

@@ -100,14 +100,15 @@ export const authorizePassword = ( auth ) => ( { authActions } ) => {
100100

101101
export const authorizeApplication = ( auth ) => ( { authActions } ) => {
102102
let { schema, scopes, name, clientId, clientSecret } = auth
103+
let headers = {
104+
Authorization: "Basic " + btoa(clientId + ":" + clientSecret)
105+
}
103106
let form = {
104107
grant_type: "client_credentials",
105-
client_id: clientId,
106-
client_secret: clientSecret,
107108
scope: scopes.join(scopeSeparator)
108109
}
109110

110-
return authActions.authorizeRequest({body: buildFormData(form), name, url: schema.get("tokenUrl"), auth })
111+
return authActions.authorizeRequest({body: buildFormData(form), name, url: schema.get("tokenUrl"), auth, headers })
111112
}
112113

113114
export const authorizeAccessCode = ( { auth, redirectUrl } ) => ( { authActions } ) => {

0 commit comments

Comments
 (0)