diff --git a/__tests__/identity.js b/__tests__/identity.js index 24d6d1a..a488077 100644 --- a/__tests__/identity.js +++ b/__tests__/identity.js @@ -243,7 +243,7 @@ describe('Identity', () => { }).toThrowError(new SDKError('The acrValues parameter is not acceptable: sms otp password youShallNoTPass')); }); - test('should accept variations of sms, otp, password, eid-no, eid-se, eid-fi, eid acrValues. Url shouldn\'t contain prompt=select_account', () => { + test('should accept variations of sms, otp, password, eid-dk, eid-no, eid-se, eid-fi, eid acrValues. Url shouldn\'t contain prompt=select_account', () => { const identity = new Identity(Object.assign({}, defaultOptions, { env: 'PRO' })); compareUrls(identity.loginUrl({ @@ -251,6 +251,11 @@ describe('Identity', () => { acrValues: 'sms', }), 'https://login.schibsted.com/oauth/authorize?redirect_uri=http%3A%2F%2Ffoo.com&client_id=foo&state=dummy-state&response_type=code&scope=openid&acr_values=sms'); + compareUrls(identity.loginUrl({ + state: 'dummy-state', + acrValues: 'eid-dk', + }), 'https://login.schibsted.com/oauth/authorize?redirect_uri=http%3A%2F%2Ffoo.com&client_id=foo&state=dummy-state&response_type=code&scope=openid&acr_values=eid-dk'); + compareUrls(identity.loginUrl({ state: 'dummy-state', acrValues: 'eid-no', diff --git a/src/identity.js b/src/identity.js index 2c7a7ed..1773086 100644 --- a/src/identity.js +++ b/src/identity.js @@ -964,7 +964,7 @@ export class Identity extends EventEmitter { teaser = arguments[6] || teaser; maxAge = isNaN(arguments[7]) ? maxAge : arguments[7]; } - const isValidAcrValue = (acrValue) => isStrIn(acrValue, ['password', 'otp', 'sms', 'eid-no', 'eid-se', 'eid-fi', 'eid'], true); + const isValidAcrValue = (acrValue) => isStrIn(acrValue, ['password', 'otp', 'sms', 'eid-dk', 'eid-no', 'eid-se', 'eid-fi', 'eid'], true); assert(!acrValues || isStrIn(acrValues, ['', 'otp-email'], true) || acrValues.split(' ').every(isValidAcrValue), `The acrValues parameter is not acceptable: ${acrValues}`); assert(isUrl(redirectUri),