I\'m trying to implement token authorization for Angular5 client and WebApi server application. I have managed to create WebApi part of the project in question and when I tr
Thanks David for your help. I tried your solution but it didn't help until I changed my WebAPI CORS settings. The issue was with Pre-flight CORS request. I followed instructions in this article and that solved my issue.
In short:
Microsoft.Owin.Cors
package.Then I modified the ConfigureAuth
method in the App_Start\Startup.Auth.cs
file with the following code:
public void ConfigureAuth(IAppBuilder app) {
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
app.UseOAuthBearerTokens(OAuthOptions);
}
That solved the issue, even with my code in Angular from the question. It now works fine.