Comments (7)
from casbin-aspnetcore.
The redirect is because of config issues in my Startup.cs
But it would be good to know whether you believe the Middleware and CasbinAuthorize attribute should work OK when using bearer token authentication.
from casbin-aspnetcore.
Seems to be working with bearer token , but I have to use both standard and casbin attribute:
[Authorize]
[CasbinAuthorize]
public IActionResult MyAction(...)
Is this intended?
from casbin-aspnetcore.
Is this code work? :
[CasbinAuthorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public IActionResult MyAction(...)
from casbin-aspnetcore.
Seems to be working with bearer token , but I have to use both standard and casbin attribute:
[Authorize] [CasbinAuthorize] public IActionResult MyAction(...)
Is this intended?
No.
Now, casbin middleware does not read the default policy or fallback policy in AuthorizationOptions, So it will not use the AuthenticationSchemes in the default policy.
But, I think we should not read those policies, we will provide AuthenticationSchemes options for this case.
from casbin-aspnetcore.
I tried [CasbinAuthorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
And it works. I don't need the extra [Authorize] attribute, and I get 401 when token is missing as expected.
Then I removed AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme
And it still works. Now I'm not able reprodue the issue.
from casbin-aspnetcore.
:tada: This issue has been resolved in version 0.2.0 :tada:
The release is available on GitHub release
Your semantic-release bot 📦🚀
from casbin-aspnetcore.
Related Issues (20)
- Update to Casbin.NET v2.0.0-preview.1 HOT 1
- Add casbin logo to nuget packages
- Fix GitHub Actions error HOT 2
- How can I make CasbinAuthorize work with a specific request transformer HOT 3
- Enforcer lifecycle, caching etc. HOT 4
- [Question] How to retrieve NetCasbin.Enforcer from ApiController? HOT 9
- how to use EFCore-Adapter together with casbin-aspnetcore HOT 3
- How to pass a custom EnforcerService or how to make dbcontext available to RequestTransformer HOT 5
- Does [CasbinAuthorize] work in Razor Pages? HOT 3
- Missing compatibility with Casbin EFCore Adapter HOT 8
- Support for imperative authorization checks HOT 6
- CodeQL CI failed HOT 3
- Fix CI error of codeql anaylzer HOT 4
- Another CodeQL CI error HOT 1
- Best way to use EF core adapter with filter HOT 3
- Using query or route params in CasbinAuthorizeAttribute HOT 1
- CI error: error CS0103: The name 'SyncedEnforcer' does not exist in the current context HOT 5
- The options.DefaultRequestTransformerType was not found HOT 12
- [bug] the commit "fix: not use ref values to transform" failed the CI tests HOT 6
- Ef core example - WebApplicationWithEfcoreSample HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from casbin-aspnetcore.