In a MAUI app, what is the full equivalent of IAzClientContext::get_UserUpn where a UPN is retrieved in the full content, even if it is in email syntax like [email protected]?
I have tried System.Security.Principal.WindowsIdentity.GetCurrent().Name & WindowsIdentity(userToken) and variations with no success. Most other functions that I have found or been told about are based on the Win32 libraries, which would bypass the MAUI cross-platform goal.
there isn't a direct equivalent method named get_UserUpn. However, to achieve similar functionality, you can use platform-specific APIs or dependency injection to access the user's UPN (User Principal Name) on each platform.
For example, on platforms like Android and iOS, you might need to use platform-specific APIs to retrieve the user's UPN, as it's not typically exposed directly through cross-platform APIs.
You can use Android's AccountManager to retrieve the user's UPN:
C#,