mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
parent
b4caac21ed
commit
3b58c994f8
@ -6,6 +6,7 @@ import { globalBeforeEach } from '../../../__jest__/before-each';
|
|||||||
const AUTHORIZE_URL = 'https://foo.com/authorizeAuthCode';
|
const AUTHORIZE_URL = 'https://foo.com/authorizeAuthCode';
|
||||||
const CLIENT_ID = 'client_123';
|
const CLIENT_ID = 'client_123';
|
||||||
const REDIRECT_URI = 'https://foo.com/redirect';
|
const REDIRECT_URI = 'https://foo.com/redirect';
|
||||||
|
const AUDIENCE = 'https://foo.com/userinfo';
|
||||||
const SCOPE = 'scope_123';
|
const SCOPE = 'scope_123';
|
||||||
const STATE = 'state_123';
|
const STATE = 'state_123';
|
||||||
|
|
||||||
@ -21,7 +22,8 @@ describe('implicit', () => {
|
|||||||
CLIENT_ID,
|
CLIENT_ID,
|
||||||
REDIRECT_URI,
|
REDIRECT_URI,
|
||||||
SCOPE,
|
SCOPE,
|
||||||
STATE
|
STATE,
|
||||||
|
AUDIENCE
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
|
@ -128,7 +128,8 @@ async function _getOAuth2ImplicitHeader(
|
|||||||
authentication.responseType,
|
authentication.responseType,
|
||||||
authentication.redirectUrl,
|
authentication.redirectUrl,
|
||||||
authentication.scope,
|
authentication.scope,
|
||||||
authentication.state
|
authentication.state,
|
||||||
|
authentication.audience
|
||||||
);
|
);
|
||||||
|
|
||||||
return _updateOAuth2Token(requestId, results);
|
return _updateOAuth2Token(requestId, results);
|
||||||
|
@ -13,7 +13,8 @@ export default async function(
|
|||||||
responseType: string = c.RESPONSE_TYPE_TOKEN,
|
responseType: string = c.RESPONSE_TYPE_TOKEN,
|
||||||
redirectUri: string = '',
|
redirectUri: string = '',
|
||||||
scope: string = '',
|
scope: string = '',
|
||||||
state: string = ''
|
state: string = '',
|
||||||
|
audience: string = ''
|
||||||
): Promise<Object> {
|
): Promise<Object> {
|
||||||
const params = [
|
const params = [
|
||||||
{ name: c.P_RESPONSE_TYPE, value: responseType },
|
{ name: c.P_RESPONSE_TYPE, value: responseType },
|
||||||
@ -32,6 +33,7 @@ export default async function(
|
|||||||
redirectUri && params.push({ name: c.P_REDIRECT_URI, value: redirectUri });
|
redirectUri && params.push({ name: c.P_REDIRECT_URI, value: redirectUri });
|
||||||
scope && params.push({ name: c.P_SCOPE, value: scope });
|
scope && params.push({ name: c.P_SCOPE, value: scope });
|
||||||
state && params.push({ name: c.P_STATE, value: state });
|
state && params.push({ name: c.P_STATE, value: state });
|
||||||
|
audience && params.push({ name: c.P_AUDIENCE, value: audience });
|
||||||
|
|
||||||
// Add query params to URL
|
// Add query params to URL
|
||||||
const qs = buildQueryStringFromParams(params);
|
const qs = buildQueryStringFromParams(params);
|
||||||
|
@ -458,7 +458,7 @@ class OAuth2Auth extends React.PureComponent<Props, State> {
|
|||||||
} else if (grantType === GRANT_TYPE_IMPLICIT) {
|
} else if (grantType === GRANT_TYPE_IMPLICIT) {
|
||||||
basicFields = [authorizationUrl, clientId, redirectUri, enabled];
|
basicFields = [authorizationUrl, clientId, redirectUri, enabled];
|
||||||
|
|
||||||
advancedFields = [responseType, scope, state, tokenPrefix];
|
advancedFields = [responseType, scope, state, tokenPrefix, audience];
|
||||||
}
|
}
|
||||||
|
|
||||||
return { basic: basicFields, advanced: advancedFields };
|
return { basic: basicFields, advanced: advancedFields };
|
||||||
|
Loading…
Reference in New Issue
Block a user