Skip to content

Commit d1c1b00

Browse files
author
Ron
authored
Merge branch 'master' into fix.info-font
2 parents 0ea1418 + 8eb5461 commit d1c1b00

File tree

9 files changed

+73
-72
lines changed

9 files changed

+73
-72
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/components/auth/oauth2.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ export default class Oauth2 extends React.Component {
141141
isAuthorized ? <code> { this.state.passwordType } </code>
142142
: <Col tablet={10} desktop={10}>
143143
<select id="password_type" data-name="passwordType" onChange={ this.onInputChange }>
144-
<option value="basic">Basic auth</option>
145144
<option value="request-body">Request body</option>
145+
<option value="basic">Basic auth</option>
146146
<option value="query">Query parameters</option>
147147
</select>
148148
</Col>

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)