IdentityServer / IdentityServer4.AccessTokenValidation

IdentityServer Access Token Validation for ASP.NET Core
Apache License 2.0
544 stars 214 forks source link

Multiple Api resources for identity server authentication #95

Closed hazelmyth closed 6 years ago

hazelmyth commented 6 years ago

Can I authenticate again more than one api resources in a single web api project?

The situation is like this: I have one web api project which include api endpoints for both the back office user (administrator) and normal user. I have two Api resources specified in Identity Server, one is "admin", the other is "normal_user". When doing access token validation, I could only specify one api resource with the api name like services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme) .AddIdentityServerAuthentication(options => { options.Authority = "https://demo.identityserver.io"; options.ApiName = "admin"; }); . Yet how could I deal with the other api resource?

leastprivilege commented 6 years ago

I would rather use one api resource - but two scopes.

hazelmyth commented 6 years ago

I see, thank you very much.