Full name mapping when using SAML

Hi there,

does anyone know how to map the full name when using SAML as login method?
My SAML response looks like this and I can map any other other attribute in my IdP if necessary:

<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Destination="https://logon.xyz.de/auth/saml/callback" ID="idLwrewprewewGG1wewe0X4VZKDDby1Htv8I" InResponseTo="_ade6fd8b-0ce0-48d0-afff-b0ad3375d8e6" IssueInstant="2018-10-18T08:05:37Z" Version="2.0">
    <saml:Issuer>https://logon.xyz.de/nidp/saml2/metadata</saml:Issuer>
    <samlp:Status>
        <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
    </samlp:Status>
    <saml:Assertion ID="id9sd5jjrejb3ererIZCJkrYjoG9_PI0" IssueInstant="2018-10-18T08:05:37Z" Version="2.0">

        ...

    <saml:AttributeStatement>
        <saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
            <saml:AttributeValue xsi:type="xs:string">USERID</saml:AttributeValue>
        </saml:Attribute>
        <saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="last_name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
            <saml:AttributeValue xsi:type="xs:string">Surname</saml:AttributeValue>
        </saml:Attribute>
        <saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="first_name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
            <saml:AttributeValue xsi:type="xs:string">Givenname</saml:AttributeValue>
        </saml:Attribute>
        <saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
            <saml:AttributeValue xsi:type="xs:string">mail@example.org</saml:AttributeValue>
        </saml:Attribute>
    </saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>

Regards,
Thilo

다른 분들도 해결책을 찾고 계신 분들을 위해 공유드립니다:

저희도 동일한 문제를 겪었으며, 소스 코드를 살펴본 후에야 해결책을 찾았습니다:

fullName은 무시됩니다.
Identity Provider(저희는 Keycloak를 사용했습니다)에서 discourse의 firstName 및 lastName 필드로 매핑이 설정되어 있어야 합니다.

코드를 자세히 살펴봐 주셔서 감사합니다! 제 생각엔 버그인 것 같아요 - fullName을 확인한 뒤에 firstName과 lastName으로 대체하고 있거든요. 해당 스니펫의 133번째 줄은 완전히 쓸모없는 코드입니다 :thinking:

이번 주에 어쨌든 SAML 플러그인 작업을 하고 있어서, 수정 사항을 공유합니다:

이 PR이 머지되면 fullName이 올바르게 우선 처리될 것입니다.

@david 빠른 수정 감사합니다!

저한테는 버그처럼 보이는데 - fullName을 확인한 뒤 firstName lastName으로 대체하고 있거든요. 그 스니펫의 133번째 줄은 완전히 쓸모없어요

저도 같은 인상을 받았지만 Ruby 문법에 익숙하지 않아서 확신이 서지 않았어요…