You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With CSharpControllerGenerator, can we generate a controller or action method annotated with the AllowAnonymous attribute?
Background: I enabled the authentication and authorization middleware in asp.net core, with the intention of having all endpoints protected by default. But there are a few endpoints that I want them to remain unprotected. For controllers I implemented, I can achieve this by applying the AllowAnonymous attribute. But for endpoints generated from openapi.json, I can't find seem to find a way for the same attribute to be applied to the generated endpoint.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
With CSharpControllerGenerator, can we generate a controller or action method annotated with the AllowAnonymous attribute?
Background: I enabled the authentication and authorization middleware in asp.net core, with the intention of having all endpoints protected by default. But there are a few endpoints that I want them to remain unprotected. For controllers I implemented, I can achieve this by applying the AllowAnonymous attribute. But for endpoints generated from openapi.json, I can't find seem to find a way for the same attribute to be applied to the generated endpoint.
Beta Was this translation helpful? Give feedback.
All reactions