I created a selfhosting webapp (Microsoft.AspNetCore.Owin) as recommended in stackoverflow by @Anouar.
It works as expected. But I can't get user information from the context. There doesn't seem to be any Claim in HttpContext.Users.Claims (nrOfClaims = 0).
public class SayHi : ControllerBase
{
[Route("sayhi/{name}")]
public IActionResult Get(string name)
{
var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
var nrOfClaims = HttpContext.User.Claims.Count();
Is it possible to get the username and the user-domainname via HttpContext here?
I searched various sites. I tried IHttpContextAccessor stackoverflow via constructor dependency injection. But the HttpContextAccessor seems to be the same as HttpContext itself.