Skip to content

Commit

Permalink
Optimize idp cloning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Feb 19, 2025
1 parent ee7d4e9 commit 0544e8f
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.util.ArrayList;
import java.util.List;

import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.LOCAL_IDP_NAME;

/**
* This class is used to manage the ApplicationAuthenticator instances.
*/
Expand Down Expand Up @@ -211,8 +213,12 @@ public IdentityProvider getSerializableIdPByResourceId(String resourceId, String
a FederatedAuthenticatorConfig instance. */
IdentityProviderManager manager =
(IdentityProviderManager) FrameworkServiceDataHolder.getInstance().getIdentityProviderManager();
return gson.fromJson(
gson.toJson(manager.getIdPByResourceId(resourceId, tenantDomain, false)),
IdentityProvider.class);
IdentityProvider idp = manager.getIdPByResourceId(resourceId, tenantDomain, false);

if (LOCAL_IDP_NAME.equals(idp.getIdentityProviderName())) {
return idp;
}

return gson.fromJson(gson.toJson(idp), IdentityProvider.class);
}
}

0 comments on commit 0544e8f

Please sign in to comment.