[Question]: Is it possible to implement multiple configurations for Angular 17 standalone components project?
What Version of the library are you using? 17.0.0
Question How can I implement multiple authentication configurations and router guards for an Angular 17 project, using standalone components?
Hi, the capabilities of the "standalone" VS "module" should be the same. The only difference is "how" this is configured within an app.
In other words, a standalone project can still use multiple configurations. As an example you can take a look at https://github.com/damienbod/angular-auth-oidc-client/blob/main/projects/sample-code-flow-standalone/src/app/app.config.ts (which is configured for a single config, but you can also provide an array of configs just as with the module approach).
Thanks for your response @timdeschryver! I have successfully implemented multiple configurations, but one thing that I am not achieving is the protection of routes via custom guard, when using multiple configurations. I saw this example in the documentation but isAuthentication is always false. I understood by the documentation that this value returns false when having multiple configurations, is there any other way I can implement it? Thanks 😀
@soniafaria I don't have "real" experience with it.
But AFAIK if you use isAuthenticated instead of isAuthenticated$ you can provide a configId.
If you provide the configuration id, isAuthenticated will return the result for that configuration.