Reputation: 481
Suppose I had a new .NET Core 2.2 Web API Project with two controllers:
[ApiController]
public class AController : ControllerBase
{
}
[ApiController]
public class BController : ControllerBase
{
}
How can I setup the identity server so that authenticating with a reference token is necessary to hit endpoints on AController, but not BController?
Upvotes: 0
Views: 125
Reputation: 4802
Only add [Authorize]
attribute to the controllers you need the users of your api to be authenticated for. Your other controllers won’t require token authentication that way.
Upvotes: 1