From 9559fbefe048b0069c39d35f957d2eb1c019e771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:08:32 +0900 Subject: [PATCH] =?UTF-8?q?spec(SSO/SAML):=20Attribute=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(MisskeyIO#792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/sso/SAMLIdentifyProviderService.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/sso/SAMLIdentifyProviderService.ts b/packages/backend/src/server/sso/SAMLIdentifyProviderService.ts index 60ce37d8e..dbf004e27 100644 --- a/packages/backend/src/server/sso/SAMLIdentifyProviderService.ts +++ b/packages/backend/src/server/sso/SAMLIdentifyProviderService.ts @@ -495,14 +495,28 @@ export class SAMLIdentifyProviderService { '#text': user.id, }, }, - ...(user.name ? [{ + { + '@Name': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn', + 'saml:AttributeValue': { + '@xsi:type': 'xs:string', + '#text': user.id, + }, + }, + { '@Name': 'firstName', '@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', 'saml:AttributeValue': { '@xsi:type': 'xs:string', - '#text': user.name, + '#text': user.name ? user.name : 'Misskey User', }, - }] : []), + }, + { + '@Name': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname', + 'saml:AttributeValue': { + '@xsi:type': 'xs:string', + '#text': user.name ? user.name : 'Misskey User', + }, + }, { '@Name': 'lastName', '@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', @@ -511,6 +525,13 @@ export class SAMLIdentifyProviderService { '#text': `@${user.username}`, }, }, + { + '@Name': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname', + 'saml:AttributeValue': { + '@xsi:type': 'xs:string', + '#text': `@${user.username}`, + }, + }, { '@Name': 'displayName', '@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic',