<div dir="ltr">We are planning to introduce support for contact email in the future. The current email field is both a login and a contact email. As it&#39;s used for login it has to be unique.<div><br></div><div>You could probably work around it with custom mappers for your IdPs that map email to an attribute rather than the user email field. Then create a custom email sender to use the contact attribute from the user rather than email field.</div><div><br></div><div>[1] <a href="https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java">https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 September 2016 at 09:17, Tomas Groth Christensen <span dir="ltr">&lt;<a href="mailto:tgc@dma.dk" target="_blank">tgc@dma.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I&#39;m involved in a project where we use Keycloak as Identity Broker, and<br>
so far we&#39;ve been very happy with Keycloak, and implemented a few SPIs<br>
to do some special things, but now we&#39;ve hit a snag...<br>
<br>
In our setup we have many clients using the Identity Broker which then<br>
again has many Identity Providers from which the user can chose one to<br>
use for login.<br>
Our problem is that the same user (using one email address) can exist<br>
in 2 or more Identity Providers, and we do not want to link these<br>
accounts. The reason for not linking the accounts is that the user can<br>
be given special privileges in clients, based on which Identity<br>
Provider the user comes from. These privileges should not be carried<br>
over from one Identity Providers user to another since the same user<br>
might be an administrator when coming the one Identity Provider and a<br>
common user when coming from a different Identity Provider.<br>
<br>
So, is it possible to allow multiple users to have the same email<br>
address? Looking at the source code there are checks for duplicated<br>
user-emails in most places where users are created... Could a solution<br>
be to implement a custom authenticator that replaces<br>
IdpCreateUserIfUniqueAuthentic<wbr>ator which does not check for duplicated<br>
emails, or are there database constraints that will prohibit this?<br>
An alternative solution could perhaps be a custom authenticator that<br>
simply deletes existing users with the same email address?<br>
<br>
I hope you can give me some pointer on how to proceed...<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Best regards,<br>
Tomas Groth Christensen<br>
Softwaredeveloper<br>
Danish Maritime Authority<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-dev</a><br>
</font></span></blockquote></div><br></div>