When auto_provision = true, and soft_auto_provision = false, we're supposed to check if the user is already present in another backend here.
When at the same time, "Use unique user IDs" is disabled (so that the "sub" from the provider is used directly as the NC user id), this check appears to break though: A new user gets provisioned nicely on the first login via OIDC, but on the second time, login fails with "User conflict" here.
Possibly userManager->get($tokenUserId); returns the OIDC user now, because there's a match between "sub" from the identity provider and "user_id" in the NC tables. In that case I guess the solution would be to check the backend of the returned user object and ignore if the backend is ourself?
When auto_provision = true, and soft_auto_provision = false, we're supposed to check if the user is already present in another backend here.
When at the same time, "Use unique user IDs" is disabled (so that the "sub" from the provider is used directly as the NC user id), this check appears to break though: A new user gets provisioned nicely on the first login via OIDC, but on the second time, login fails with "User conflict" here.
Possibly
userManager->get($tokenUserId);returns the OIDC user now, because there's a match between "sub" from the identity provider and "user_id" in the NC tables. In that case I guess the solution would be to check the backend of the returned user object and ignore if the backend is ourself?