Skip to content

Commit

Permalink
fix(SSO): SAML認証が正常に動作しない問題を修正 (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored Mar 16, 2024
1 parent b33cc20 commit 142a906
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 116 deletions.
2 changes: 2 additions & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"nanoid": "5.0.6",
"nested-property": "4.0.0",
"node-fetch": "3.3.2",
"node-forge": "1.3.1",
"nodemailer": "6.9.12",
"nsfwjs": "2.4.2",
"oauth": "0.10.0",
Expand Down Expand Up @@ -213,6 +214,7 @@
"@types/mime-types": "2.1.4",
"@types/ms": "0.7.34",
"@types/node": "20.11.27",
"@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.14",
"@types/oauth": "0.9.4",
"@types/oauth2orize": "1.11.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
name: ps.name ? ps.name : null,
type: ps.type,
issuer: ps.issuer,
audience: ps.audience?.filter(i => !!i),
audience: ps.audience?.filter(i => i.length > 0) ?? [],
acsUrl: ps.acsUrl,
publicKey: publicKey,
privateKey: privateKey,
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/server/api/endpoints/admin/sso/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export const meta = {
type: 'string',
optional: false, nullable: false,
},
useCertificate: {
type: 'boolean',
optional: false, nullable: false,
},
publicKey: {
type: 'string',
optional: false, nullable: false,
Expand Down Expand Up @@ -100,6 +104,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
issuer: service.issuer,
audience: service.audience,
acsUrl: service.acsUrl,
useCertificate: service.privateKey != null,
publicKey: service.publicKey,
signatureAlgorithm: service.signatureAlgorithm,
cipherAlgorithm: service.cipherAlgorithm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
await this.singleSignOnServiceProviderRepository.update(service.id, {
name: ps.name !== '' ? ps.name : null,
issuer: ps.issuer,
audience: ps.audience?.filter(i => !!i),
audience: ps.audience?.filter(i => i.length > 0),
acsUrl: ps.acsUrl,
publicKey: publicKey,
privateKey: privateKey,
Expand Down
Loading

0 comments on commit 142a906

Please sign in to comment.