enhance(SSO): Attributeの調整 (MisskeyIO#555)

This commit is contained in:
まっちゃとーにゅ 2024-03-21 08:08:28 +09:00 committed by GitHub
parent 478c1eb087
commit eb884721bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 6 deletions

View file

@ -492,20 +492,28 @@ export class SAMLIdentifyProviderService {
'#text': user.id,
},
},
{
'@Name': 'displayname',
...(user.name ? [{
'@Name': 'firstName',
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
'saml:AttributeValue': {
'@xsi:type': 'xs:string',
'#text': user.name ?? user.username,
'#text': user.name,
},
}] : []),
{
'@Name': 'lastName',
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
'saml:AttributeValue': {
'@xsi:type': 'xs:string',
'#text': `@${user.username}`,
},
},
{
'@Name': 'name',
'@Name': 'displayName',
'@NameFormat': 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic',
'saml:AttributeValue': {
'@xsi:type': 'xs:string',
'#text': user.username,
'#text': user.name ? `${user.name} (@${user.username})` : `@${user.username}`,
},
},
{