Windows/AD authentication between Angular SPA and .NET API
As mentioned in title, I have .NET API which will be used for my Angular SPA. Some pages needs to be protected, and I would like to use AD / Windows auth for it.
Curently, I managed to find one solution, to set my API for Windows Auth and Check
context.User.Identity
. In my angular app, I set withCredentials: true
before sending the request. this technically works. But. Occasionally, that default "windows login" popup appears, is there any way to prevent that and automatically grab the users identity/credentials? Or is this an okay workflow for that?1 Reply
Use Identity to secure a Web API backend for SPAs
Learn how to use Identity to secure a Web API backend for single page applications (SPAs).