-
Notifications
You must be signed in to change notification settings - Fork 437
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
How to change configuration at runtime ? #923
Comments
Hey, currently we do not have an option to change configuration at runtime. You could, however, save the sts server the user gave you, reload the application and provide it through a service. The service reads the sts server the user entered and passes it into the config. Add the servie to the |
Also interested in this. Not to fond of browser reload though. |
We could probably add support for this, does not seem like a big change or effort |
Thank you. |
Instead of opening a new issue for a related question. I think this is in line with what i'm looking for. I used another library in the past and just updated the config when the user selected the IdP. |
@martijnvanschie This is not supported at present. We plan to support this by using multiple IDP configuration support. We hope it makes version 12. Greetings Damien |
@damienbod that would be a very nice addition. Looking forward to this 😀 |
I've got pretty far using this lib and Ionic + Capacitor but hit this roadblock when it came to deploy. We want customers to be able to enter their hosted URL of our app then we set the STS server to that. A full page refresh isn't really an option in an Ionic app. Development wise, I've hooked into the urlHandler with Capacitor's Browser.open({ url }) and listened to the events, so locally it works fine. Just won't be deployable easily. |
Hey, I just gave this thing a look because we are heavily working on V12. In V12 we are supporting multiple IDPs. So you can pass multiple configs and of course run with one single config as well. Here are the things which came into my mind: Technically switching the config is not such a great deal, it is doable. If we switch the configuration at runtime, we can not do a logout at the server, because this would cause a redirect to the sts. Which you do not want when you only want to switch configs. So we can only do Currently, we are not storing the complete config in the storage but only in memory because of performance reasons. We are only storing the Also, when looking from the multiple config perspective we would have to support adding a config, replacing a single config, removing a config from multiple configs and replacing multiple configs with other configs. And when refreshing all the original configs would be set again. So when replacing the config the user has configured A, but running with B OR has A, B, C, ... configured and is running with D, E and F ... This would lead so inconsistency. Yeah, that is my two cents on that. I don't know how we can solve this to make it useable for the users and am open for proposals. Thanks, Fabian |
Hi. I struggling right now with such case. We had SaaS application where our tenants user should can setup their own oidc servers. So we right now kept this information on our backend about which sts server they want to use and then send it on app initialization. This is not a case of multiple IDPs cause each tenant can have only one, but how right now load this configuration into angular-auth-oidc-client so we can allow login into app from some sts? |
Hey @CrazyBaran, we support loading the config from an HTTP source. See https://github.com/damienbod/angular-auth-oidc-client/blob/main/projects/sample-code-flow-http-config/src/app/auth-config.module.ts for reference. |
@FabianGosebrink Ah nice, so sorry for bother. |
No worries. All good, :-) We are improving the docs in V12 and hope this can be done more obvious then. |
After having no feedback on this, I am afraid we have to postpone this feature. I currently see no way to change the config at runtime without having an inconsistency in the configs. |
Hi, I know this thread has been closed, but could you tell me if there is a way to switch between config at runtime at all? I upgraded to v14 and looks like OidcConfigService is not exported anymore or available - so my work around using .withConfigs does not work. I was combining that and overriding storage to load different configs (external providers) in a demo app. |
Yes, switching configs at runtime is not possible. Not without a reload. |
I tried the same thing on my application, but the http request never hits a backend. Just simply returning a |
I couldn't find a way to change some configuration after lib initialisation.
My intention is to replace a "default" value for
stsServer
with one taken from a configuration form.How to achieve this ?
The text was updated successfully, but these errors were encountered: