I am setting up our legacy application as an IdP. When a user goes to the new site (Angular 13), it sends them to Keycloak, which immediately redirects the user to the legacy site for authentication. Once the user is authenticated, it redirects them back to Keycloak, which creates a local account and then everything is fine.
The problem is whatever account is first created is the only account that will ever exist. If I open the app in incognito, the same flow happens. The new app redirects to Keycloak which immediately redirects to the legacy app. The user logs in, I create a code, send that back to Keycloak, it calls for that token & I return a new object with the JWT in it.
Then the pages redirect, but Keycloak only sends me the first account information. It never creates a 2nd account, and it doesn’t matter who I log in as, I’m always going to be the first account.
I assume this is because I’ve set something up incorrectly (or the Keycloak angular plug in I’m using is bad), but I don’t know how to trouble shoot this.