Skip to content

Commit f1734e6

Browse files
committed
fix: enclose SAML authn context values in brackets
When writing multiple values for the SAML_AUTHN_CONTEXT setting, the entire value must be enclosed in square brackets ([]), otherwise the service will treat the entire value as one context. npm test passes
1 parent 2a5d884 commit f1734e6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/features/admin/domain/usecases/ConvertFromProviders.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function convert(settings, provider, mapping, deleteFn) {
6868
settings.set(env, contexts[0])
6969
} else {
7070
const authnContext = contexts.map((e) => `"${e}"`).join()
71-
settings.set(env, authnContext)
71+
settings.set(env, `[${authnContext}]`)
7272
}
7373
}
7474
} else {

test/features/admin/domain/usecases/ConvertFromProviders.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('ConvertFromProviders use case', function () {
6060
'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos',
6161
'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
6262
]
63-
const authnContext = contexts.map((e) => `"${e}"`).join()
63+
const authnContext = '[' + contexts.map((e) => `"${e}"`).join() + ']'
6464
const settings = new Map()
6565
const providers = [{
6666
label: 'Acme Identity',

test/features/admin/domain/usecases/WriteConfiguration.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe('WriteConfiguration use case', function () {
278278
'urn:oasis:names:tc:SAML:2.0:ac:classes:Kerberos',
279279
'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
280280
]
281-
const authnContext = contexts.map((e) => `"${e}"`).join()
281+
const authnContext = '[' + contexts.map((e) => `"${e}"`).join() + ']'
282282
const readStub = sinon.stub(ConfigurationRepository.prototype, 'read').callsFake(() => {
283283
return new Map()
284284
})

0 commit comments

Comments
 (0)