-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registration | Company Name Change Not Reflecting Consistently #942
Comments
Hi @ntruchsess @Phil91 if you have any idea or suggestion for this fix , please share. My idea is to get the Id provider and changes the display name and then update it again. |
@dhiren-singh-007 in my opinion adding the calls to update the organisation for the users of the company and a call to update the org name on the shared idp should be fine, since they are only updates, if it fails while updating retriggering the api is just fine. |
Thanks @Phil91 , I am not sure if i understood your point completely. And in Portal This is showing from token attribute "Organisation" which is defined via Mapper attribute in Identity provider for specific company as shown Eg: Lets say one user changed the company name and saved the address during registration and didn't continue further . I am thinking something like this for company name and same way for attribute mapper (most probably in this method only). And then call this in the above api. public async Task UpdateCompanyNameIdentityProviders(string aliasName, string organisationName, CancellationToken cancellationToken)
{
var keycloak = _keycloakFactory.CreateKeycloakClient("central");
try
{
var identityProvider = await keycloak.GetIdentityProviderAsync(_settings.CentralRealm, aliasName, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
identityProvider!.DisplayName = organisationName;
await keycloak.UpdateIdentityProviderAsync(_settings.CentralRealm, identityProvider!.Alias, identityProvider, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
}
catch (Exception ex)
{
throw ex;
}
} Please share your thoughts |
adding @MaximilianHauer |
@dhiren-singh-007 you're right, the proposed method looks good for me. what is still missing in my opinion is a method to change the user attribute for all users that are assigned to the company: |
adding @oyo |
Currently in the rename process only the DB records are updated not the Keycloak realm and display name. On frontend side we are showing the user data from the Keycloak token which contains the original company name. We could trigger another call to the backend after each login but it would be way more efficient to fix the data in the one rename API call with one Keycloak API call from BE to BE instead of one additional call from FE to BE in every user session. |
yes , i missed that point . Thanks for highlighting it.
Now i will start working on this. |
Hi @Phil91 , While implementing the solution, I found that the 3rd point is not needed. This is because when the Organization attribute of an Identity Provider (IDP) is updated in the central IDP, Keycloak triggers an internal event whenever a user associated with that IDP logs in. This event automatically updates the user’s attributes, including the Organization attribute, after their login. |
@dhiren-singh-007 do you know if this is a specific keycloak configuration or if this is a base setup? @evegufy what's your opinion on that, should we rely on the fact that keycloak might be configured to handle this or do it in the code? |
Current Behavior
When inviting a Business Partner in CX Admin, the initial Company Name (e.g., ABC) was specified. However, during the company registration process via the access link provided in the invite email, the Company Name was changed to (e.g., XYZ). Despite the change being reflected correctly on the Business Partner invite page within CX Admin, it does not update uniformly on the company user side, where the original Company Name (ABC) remains visible when accessed through the user icon.
Additionally, the Company Name remains unchanged on the Catena-X Home Page.
Expected Behavior
The Company Name displayed on the company user side should reflect the latest change made during the registration process. In this case, it should display "XYZ" after the Business Partner updates it during registration.
Steps To Reproduce
Example screenshots:
Company invited as Neha -Email Template
On submit registration company name changed to Müller as shown
Now when company go to select company name in login screen , Central idp is still showing old company name
Now company admin logged and open User icon as shown , it is still showing old company name
RCA : Old Company name is coming from display name and Organization mapper attribute which is part of IDP of that specific company.
The text was updated successfully, but these errors were encountered: