mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Merge branch 'develop' of github.com:getinsomnia/insomnia into develop
This commit is contained in:
commit
da442a73d6
@ -10,6 +10,7 @@ export const RESPONSE_TYPE_TOKEN = 'token';
|
||||
export const P_ACCESS_TOKEN = 'access_token';
|
||||
export const P_CLIENT_ID = 'client_id';
|
||||
export const P_CLIENT_SECRET = 'client_secret';
|
||||
export const P_AUDIENCE = 'audience';
|
||||
export const P_CODE = 'code';
|
||||
export const P_ERROR = 'error';
|
||||
export const P_ERROR_DESCRIPTION = 'error_description';
|
||||
|
@ -72,7 +72,8 @@ async function _getOAuth2ClientCredentialsHeader (
|
||||
authentication.credentialsInBody,
|
||||
authentication.clientId,
|
||||
authentication.clientSecret,
|
||||
authentication.scope
|
||||
authentication.scope,
|
||||
authentication.audience
|
||||
);
|
||||
|
||||
return _updateOAuth2Token(requestId, results);
|
||||
|
@ -12,7 +12,8 @@ export default async function (
|
||||
credentialsInBody: boolean,
|
||||
clientId: string,
|
||||
clientSecret: string,
|
||||
scope: string = ''
|
||||
scope: string = '',
|
||||
audience: string = ''
|
||||
): Promise<Object> {
|
||||
const params = [
|
||||
{name: c.P_GRANT_TYPE, value: c.GRANT_TYPE_CLIENT_CREDENTIALS}
|
||||
@ -20,6 +21,7 @@ export default async function (
|
||||
|
||||
// Add optional params
|
||||
scope && params.push({name: c.P_SCOPE, value: scope});
|
||||
audience && params.push({name: c.P_AUDIENCE, value: audience});
|
||||
|
||||
const headers = [
|
||||
{name: 'Content-Type', value: 'application/x-www-form-urlencoded'},
|
||||
|
@ -159,6 +159,10 @@ class OAuth2Auth extends React.PureComponent<Props, State> {
|
||||
this._handleChangeProperty('tokenPrefix', value);
|
||||
}
|
||||
|
||||
_handleChangeAudience (value: string): void {
|
||||
this._handleChangeProperty('audience', value);
|
||||
}
|
||||
|
||||
_handleChangeGrantType (e: SyntheticEvent<HTMLInputElement>): void {
|
||||
trackEvent('OAuth 2', 'Change Grant Type', e.currentTarget.value);
|
||||
this._handleChangeProperty('grantType', e.currentTarget.value);
|
||||
@ -306,6 +310,13 @@ class OAuth2Auth extends React.PureComponent<Props, State> {
|
||||
'Change Authorization header prefix from Bearer to something else'
|
||||
);
|
||||
|
||||
const audience = this.renderInputRow(
|
||||
'Audience',
|
||||
'audience',
|
||||
this._handleChangeAudience,
|
||||
'Indicate what resource server to access'
|
||||
);
|
||||
|
||||
const credentialsInBody = this.renderSelectRow(
|
||||
'Credentials',
|
||||
'credentialsInBody',
|
||||
@ -342,7 +353,8 @@ class OAuth2Auth extends React.PureComponent<Props, State> {
|
||||
advancedFields = [
|
||||
scope,
|
||||
credentialsInBody,
|
||||
tokenPrefix
|
||||
tokenPrefix,
|
||||
audience
|
||||
];
|
||||
} else if (grantType === GRANT_TYPE_PASSWORD) {
|
||||
basicFields = [
|
||||
|
Loading…
Reference in New Issue
Block a user