Skip to content

Commit

Permalink
fix: introduce openid scope (#544)
Browse files Browse the repository at this point in the history
* fix(scopes): add openid

* fix(sgid): properly include openid scope
  • Loading branch information
LoneRifle committed May 18, 2023
1 parent 15a4062 commit c90632e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/express/sgid.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function config(app, { showLoginPage, serviceProvider }) {
const encryptedNric = await encryptPayload(nric)
const scopesArr = scopes
.split(' ')
.filter((field) => field !== 'openid' && field !== 'myinfo.nric_number')
.filter((field) => field !== 'myinfo.nric_number')
console.info(`userinfo scopesArr ${scopesArr}`)
const myInfoFields = await Promise.all(
scopesArr.map((scope) =>
Expand Down Expand Up @@ -236,6 +236,8 @@ const concatMyInfoRegAddr = (regadd) => {
const sgIDScopeToMyInfoField = (persona, scope) => {
switch (scope) {
// No NRIC as that is always returned by default
case 'openid':
return persona.uuid.value
case 'myinfo.name':
return persona.name.value
case 'myinfo.email':
Expand Down

0 comments on commit c90632e

Please sign in to comment.