I have one ASP .NET MVC application. It is having both MVC controllers and API controllers. I am using OAUTH 2 for authentication. When i enable OAUTH authentication, it shows authorization error for normal controller action also.
The code i am using for registering authentication.
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
var config = new HttpConfiguration();
AppStart(config);
SwaggerConfig.Register(config);
HttpServer server = new HttpServer(config);
// Accepts OAuth Service v1.0 tokens
if (!string.IsNullOrEmpty(IdentifierUrl))
{
app.Map(
new PathString("/v1"),
p =>
{
// Map to use OAuth 1 tokens
p.UseEsoAccessTokenValidation(new EsoAccessTokenOptions { AuthorizationServerUrl = AuthorizationServer, Audiences = IdentifierUrl.Split(',') });
p.UseWebApi(server);
});
}
// Accepts OAuth Service v2.0 tokens
//app.Map("/v2", v2app =>
//{
app.UseEsoAccessTokenValidation(new EsoAccessTokenOptions
{
AuthorizationServerUrl = AuthorizationServer,
Scopes = Scopes.Split(',')
});
This is the error i am getting for each and every urls.

