Open slutske22 opened 3 years ago
@maxmantz Is there a way to load the sso configurations from API call response in the UserManagerSettings. (issuer url, client id, client secret). The api call function is not waiting to load the config. Already got struggled for 2 days. Any help would be appreciated.
I already saw this link. But it doesn't help.
I have a scenario where my application makes a call to the server to get more information about the OIDC client to be used. Specifically, what port the OIDC can be found at. This call does not happen until the app is loaded and the store was created. I create and use my userManager as described in the docs:
The the App is created with the userManager and whatever default authority in there. However, when App mounts, it calls
requestAuthSettings
, which is a redux action creator that triggers an api call. When the call returns, I use sagas to process the response. They response contains a port where the OIDC authority can be found. Based on the user's installation of the application, this may be different from the default.Is there a way to update the
authority
after creation? While examining the userManager object, there is the_settings
property which contains the_authority
string. Once the response comes back, I'm tempted to just do this:But I have a feeling that directly settings the
._settings._authority
property like that is a very bad idea, and will not create consistent results. I'm bending over backwards trying to come up with ways to only create the userManager and callloadUser
after the store is created, but its causing various refresh / flickering problems. Is there a better way to do this?