Skip to content
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

[Question]: How to load configuration dynamically during runtime in v14 #1586

Closed
AD1306 opened this issue Nov 17, 2022 · 5 comments
Closed
Labels

Comments

@AD1306
Copy link

AD1306 commented Nov 17, 2022

I'm migrating to v14 of this library where OidcConfigService isn't part of the library anymore. I have a use case where I'm fetching configs based on user selection i.e. my application supports user to log into multiple configs and I was able to load the config like below previously.

      this.oidcConfigService
            .withConfigs([oidcConfig])
            .toPromise()
            .then(() => {
               // do things here with that config i.e. checkAuth, authorize, etc.
            })

Question
How do I do the same with the v14 library. I tried to do something like this :

      new StsConfigStaticLoader(oidcConfig).loadConfigs().subscribe(x => {
        // do things here
       });

This doesn't seem to execute. I'm not a observable expert so, if I've misunderstood the usage please let me know. The root of the problem being how do I load configs dynamically at runtime.

Thanks,
Aditya Dave

@FabianGosebrink
Copy link
Collaborator

FabianGosebrink commented Nov 17, 2022

You can not set the config at runtime anymore. However, you can load the configs at the start via HTTP and then start the app and use the configId the user has choosen (We are supporting multiple configs). Or, you can save the config, the user has chosen, save it in localstorage and do a reload of the app, then read it again and pass it into the lib.

@AD1306
Copy link
Author

AD1306 commented Nov 17, 2022

Was there a reason that was removed ? Just for the completeness of this thread.

@FabianGosebrink
Copy link
Collaborator

I have explained this in an issue before, let me just link that here: #923 (comment) . I am not lazy to answer, it is just I would write the same again. Don't want to be unpolite :)

@AD1306
Copy link
Author

AD1306 commented Nov 17, 2022

No worries. Thank you for the help ! Appreciate it.

@maddydhar27
Copy link

maddydhar27 commented Jul 31, 2023

I want to ready query parameter to get tenantName and assign to cutomParamsAuthRequest, can you please help?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants