어느 정도 Keycloak를 Discourse와 SAML 인증에 맞게 구성했고, 투명 사용자 생성도 작동합니다.
하지만 현재 사용자 필드 전달에 문제가 있습니다.
인터넷에서 찾은 다음 필드 매핑을 Keycloak SAML에 구성했습니다:
Discourse에 로그인하면 Keycloak를 통해 새 사용자가 생성됩니다. Keycloak에서 사용자의 모습은 다음과 같습니다:
그 후, 생성된 사용자가 Discourse로 전송됩니다. 매핑이 설정된 필드가 Discourse로 전송되는 방식은 다음과 같습니다:
.............................
<saml:AttributeStatement>
<saml:Attribute FriendlyName="Email" Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">a.nakhimov@yandex.ru</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute FriendlyName="Username" Name="name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">v.pupkin</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
........................
Discourse에서 제출된 사용자의 모습은 다음과 같습니다:
1, 3, 4번 항목은 완전히 정확합니다. 하지만 2번 항목은 마음에 들지 않습니다… Keycloak에서는 사용자에게 정상적인 이름(First Name)과 성(Last Name)이 있습니다. 왜 Discourse에서는 이름의 첫 글자만 남아 있을까요? 이 문제를 해결할 방법이 있을까요? SAML에서 다른 매핑을 해야 하는 걸까요?



