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