Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IdentityServer4: scope authentication attribute?

Just asking, is there any way to protect different controllers or actions with different scopes? So far I have only seen one global scope for the whole app.

In identity server 3 there seems to have been a ScopeAuthorize attribute but I can't find it in IdentityServer4.

like image 663
Volker Avatar asked Sep 26 '26 00:09

Volker


1 Answers

See https://github.com/IdentityServer/IdentityServer4/issues/247 . So you create a policy and then use that policy in the Authorize Attribute.

like image 153
Volker Avatar answered Sep 28 '26 01:09

Volker