AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.61k stars 2.64k forks source link

Not able to declare msalservice as @optional in angular #2323

Open mehavel opened 3 years ago

mehavel commented 3 years ago

Please follow the issue template below. Failure to do so will result in a delay in answering your question.

Library

msal@1.3.2 @azure/msal-angular@1.0.0

Framework

Angular 9

Description

Angular has the feature to inject optional dependency. Not able to inject msal service as optional.

Error Message

No provider for msal service (declared @optional for msalservice)

Security

Regression

2316 Expected behavior

msalservice should be an optional dependency and should not throw any error

Browsers/Environment

jasonnutter commented 3 years ago

@mehavel Can you provide more detail on why the msal service should be marked as optional?

mehavel commented 3 years ago

@jasonnutter we are planning to load a module, without authentication. the other modules will be disabled for the first time. During the next load all the modules will be enabled and will be behind msal. The is based on a feature flag. We tried injecting msalservice as optional for the first time and it did not work. hope this helps

jasonnutter commented 3 years ago

@mehavel Makes sense, thanks for the explanation.

github-actions[bot] commented 3 years ago

This issue has not seen activity in 14 days. It will be closed in 7 days if it remains stale.

sameerag commented 2 years ago

@jo-arroyo @EmLauber Are we planning to support this? Can we also mark it in the backlog?