diff --git a/lib/assertions.js b/lib/assertions.js index b85f573..ec2d74f 100644 --- a/lib/assertions.js +++ b/lib/assertions.js @@ -64,6 +64,9 @@ const oidc = { { nric: 'F1612358R', uuid: '45669f5c-e9ac-43c6-bcd2-9c3757f1fa1c' }, { nric: 'F1612354N', uuid: 'c38ddb2d-9e5d-45c2-bb70-8ccb54fc8320' }, { nric: 'F1612357U', uuid: 'f904a2b1-4b61-47e2-bdad-e2d606325e20' }, + { nric: 'Y4581892I', uuid: 'acf8edda-bfdf-45fc-b140-a6ec6955d857' }, + { nric: 'Y7654321K', uuid: '9916f054-488e-4894-8299-412e46d89e67' }, + { nric: 'Y1234567P', uuid: '0fdcc18f-840b-4b35-80ee-44094a6cc66f' }, ...Object.keys(myinfo.v3.personas).map((nric) => ({ nric, uuid: myinfo.v3.personas[nric].uuid.value, @@ -136,8 +139,16 @@ const oidc = { accessToken = crypto.randomBytes(15).toString('hex'), ) => { let sub + const sfa = { + Y4581892I: { fid: 'G730Z-H5P96', coi: 'DE', RP: 'CORPPASS' }, + Y7654321K: { fid: '123456789', coi: 'CN', RP: 'IRAS' }, + Y1234567P: { fid: 'G730Z-H5P96', coi: 'MY', RP: 'CORPPASS' }, + } if (nric.startsWith('Y')) { - sub = `s=${nric},fid='G730Z-H5P96',coi='DE',u=${uuid}` + const sfaAccount = sfa[nric] + ? sfa[nric] + : { fid: 'G730Z-H5P96', coi: 'DE', RP: 'CORPPASS' } + sub = `s=${nric},fid=${sfaAccount.fid},coi=${sfaAccount.coi},u=${uuid}` } else { sub = `s=${nric},u=${uuid}` }