MSAL: getting logged in user in C# layer in MSAL project

Miguel 270 Reputation points
2024-06-19T14:48:29.0566667+00:00

I have an MSAL project built upon the sample code from Microsoft. Angular front end and .net backend, in the UI I get the logged in user email using the instance of MSAL

this.authService.instance.getAllAccounts()[0];

how can I get the logged in user in the .net without sending it from the UI?thx

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,202 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,554 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,293 questions
{count} votes