User registration: Duplicate e-mail addresses with different EGI AAI IDs
The current workflow of creating user accounts coming from EGI AAI could suffer as an e-mail address can be used more often. You can have an account at your institution that is bound to the e-mail address of your institution, e.g. klaus@my-institution.edu but you may also use the same e-mail address for your Google account, GitHub account or for a broker institution like Dariah. When you first register by using the EGI AAI with your institution login from the EGI AAI list, it will be created in the MP. If you later login by using a different provider from the EGI AAI list like GitHub, you will get an error at the MP:
There was an unexpected error (type=Internal Server Error, status=500).
could not execute statement; SQL [n/a]; constraint [uk_6dotkott2kjsp8vw4d0m25fb7]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
In the logfiles it will tell you:
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "uk_6dotkott2kjsp8vw4d0m25fb7",
Detail: Key (email)=(klaus@dmy-institution.edu) already exists.,
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2505),
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2241),
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310),
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:447),
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:368),
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:158),
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:124),
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61),
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java),
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197),
... 86 common frames omitted,
I tried it out with my account via DARIAH and later on with my account via GitHub (both the same e-mail addresss). The first is the one that is already registered, there it works. The second one will raise the error from above. (tried it out for develop and stage) The main issue is that EGI will create different EGI IDs for the same e-mail address.
Not sure, how to handle this. Do we like to allow different accounts with the same e-mail address?
@mkozak @matej.durco @lbarbot @carsten.thiel @ymoranv @edward.gray @stefan.probst