I have a question regarding SharePoint development. I'm working on a SPFX webpart for SP2019, the webpart is going to retrieve data from external source and the data will contain AD users. In my webpart I would like to show the Name of the user instead of his AD account. How can I achieve that exactly?
So the value that I get is domain\username.
I got so far that I can get the user display name with pnp js sp.web.siteusers and loginame like so "i:0#.w|domain\username" , so it is basically from _api/web/siteusers. BUT the problem is, that ofcourse I do not see all the users there that are in AD.
For example, I know that user has rights to access the site, but he never visited it, so I could not find his login in siteusers.
I tried as well the sp.web.ensureuser() but the thing i have to pass is a bit different what I have... and again it says that it will add the user to the web, what is not really needed as wel. I just need to get the name.
So how exactly, can I then get the name of the user or a group?