'Sharepoint Online - UserId.NameId using C#

I tried to get nameId from SharePoint using C# .net6. I know it can be used rest API to get nameId. is there any way to get it using C# or combination of C# with rest API. I'm using AD certificate to get access to SharePoint.



Sources

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

Source: Stack Overflow

Solution Source