'How do you apply the JWT from msTeamsSilent demo to the ClaimsIndentity and ensure it uses the msTeamsSilent when encountering Authorize tag?

The example can be found here: https://github.com/vitNickW/TeamsAppMultiAuth/tree/main/src/TestTeamsAuthSSO

msTeamsSilent is being used to launch a popup to allow Microsoft Identity authentication to function within an IFrame (the default redirect will not work). However, the code doesn't seem to do anything with the actual JWT that is returned and it is not updating the ClaimsIdentity.

How do you:

  • ...update the ClaimsIdentity so that an MVC project will recognize that the authentication was completed?
  • ...get the [Authorize] tag to call the popup routine instead of doing the redirect if the user is not already authenticated?
  • ...get the authorization to persist from one page to another?

We are OK if you only can provide a fix using .NET Code instead of .NET Framework.

We are OK if a different authenticating method is used (e.g., MSAL instead of ADAL). The important part is that we need a Popup instead of a Redirect authentication and have it recognized correctly by the MVC application.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source