I have a ASP.NET WebAPI which works perfect. When the Client calls my API I can read the User in the ApiController-Class and get the IPrincipal with all the values (it is a ClaimsPrincipal).
Now, my WebAPI calls another WebAPI. There is no authentication against this WebAPI. Then I read ghere the User from the ApiController-Class, it seems to be empty (and it is a WindowsPrincipal).
How can I forward the ClaimsPrincipal from the authenticated first WebAPI-Call to the second WebAPI, that I can there read the User-Data?
CodePudding user response:
You can pass user user principals as a header value (converting to json or another string object notation) to another webapi. After that you can read the header value and can use it.