I am working on an ASP.NET Core 2.0 API. Currently this API supports a Service to Service workflow where the client console application obtains an access token from Azure AD using their console application's Azure AD app registration AppId/AppKey values.
To support this, my API uses...
// Add Azure AD OAUTH2.0 Authentication Services
services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddAzureAdBearer(options => Configuration.Bind("AzureAd", options));
in Startup.cs ConfigureServices method and...
app.UseAuthentication();
in the Startup.cs Configure method. And finally the ...
[Authorize]
attribute along with the...
using Microsoft.AspNetCore.Authorization;
using statement in my controllers.
This is all working fine right now.
However, I now have a need to allow an admin web app to access my API. This admin web app will use Azure AD to authenticate the user login and obtain an Identity Token. I want my API to also be able to accept this Identity Token to;
- Allow access to the API, and
- Allow my API to identify the user and make decisions in the API based upon the user identity's claims.
Can ASP.NET Core 2.0 support both access token and identity token without breaking what I currently have working with the service to service workflow?