Open LALITAMITTAL18 opened 1 month ago
Hi @LALITAMITTAL18 - the blazor webassembly version uses MSAL Javascript, not MSAL .NET. Please log an issue to https://github.com/AzureAD/microsoft-authentication-library-for-js
No I am using msal .net library. I have created a service and injected in program.cs. And calling the service in a razor component. It’s all .net code. I am just getting office add in token in js and for that I am using jsinterop and passing to my services for exchange. This is the smaple from MS on which my code is based on - https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/blazor-add-in/word-blazor-add-in/word-blazor-add-in
@bgavrilMS could you please open the ticket again. This is not closed. or let me know if I have to create a new ticket.
@LALITAMITTAL18 - I know you're dealing with C# code only, but Blazor is just wrapping JS code behind a C# interface.
Where exactly do you call AcquireTokenInteractive?
I call AcquireTokenOnBehalfOf in a class AuthenticationManager.cs and that class I inject in a razor component and use it. This whole thing work in asp.net core app with razor pages using same jsinterop. I created a teams app ang get teams token using jsinterop from js file to cs file and provide it to my authentication manager for AcquireTokenOnBehalfOf method.
What is the full stack trace? MSAL .NET doesn't throw PlatformNotSupportedException afaik,
Library version used
4.64.1
.NET version
Net 8.0
Scenario
PublicClient - desktop app
Is this a new or an existing app?
None
Issue description and reproduction steps
we are creating a office add in using Blazor Standalone WebAssembly App . I get the office token and trying to exchange it using AcquireTokenOnBehalfOf but I get System.PlatformNotSupportedException when using AcquireTokenInteractive
Relevant code snippets
Expected behavior
I should get a token
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response