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',