damienbod / angular-auth-oidc-client

npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
https://www.npmjs.com/package/angular-auth-oidc-client
MIT License
1.15k stars 434 forks source link

[Question]: How can I load a dynamic number of configurations from a custom service? #1619

Open lordrhodos opened 1 year ago

lordrhodos commented 1 year ago

What Version of the library are you using? 13.1.0

Question How can I load an dynamic (unknown att app startup) number of configurations from an external api?

I have read the documentation, examples and issues about how to use the StsConfigHttpLoader to load one or multiple configurations via an async http call, but I wonder if there is any possibility to support the following scenario.

I have an app with a landing page where a list of current project is displayed. This landing page does not require any authorization and will never reqiure that in the future. Opening one of the projects starts the same app in a new tab within the project context. This is setup as a lazy loading module and an attached project resolver.

Important: a project may require authentication or not.

So I have a dynamic / unknown number of configurations which I would like to configure.

I would happy about any pointers / directions how to solve this. Only solution I see right now would be to split the application into an overview application and an application that serves the project context, but I would like to avoid that if possible.

Thanks for your feedback 🙏

lordrhodos commented 1 year ago

Found a comment here and will give this a try.

FabianGosebrink commented 1 year ago

Were you successful with this?

lordrhodos commented 1 year ago

@FabianGosebrink not yet, I ended up to add the known number of observables for the time being. But the work on it is on hold for a couple of weeks, so I will hopefully get to look into it further soon.