For standard connections, the value of user.identity.connection is the connection.name. However, for custom oauth2 connections that are linked to a user, the value is always “oauth2”.
The value of these linked connections should be the connection.name too.
Steps to reproduce:
- Create a new user Joe Regular with a “Database-Connection” in Client #1
- Create a custom oauth2 connection using a non-builtin provider and name it “Shopify-Connection” e.g. Shopify
- Authorize a user Bob Shopify against the connection using Client #2
- Link the Bob account to Joe’s to merge the identities
There will now be two identities under Joe.
user.identity[0].connection: "Database-Connection"
-
user.identity[1].connection: "oauth2"
<= this should be “Shopify-Connection”
The only workaround I’ve found is encoding the true connection.name into the user_id.
===
Also - Why doesn’t user.identity include the connection.id in the response? That information would be extremely useful in finding which identity belongs to which connection.
Edit: That’s weird. Now I’m seeing connection_id
in my identity responses.