question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IAuthorizationFilter blocking Smidge route

See original GitHub issue

When I try to use a IAuthorizationFilter implementation, I had to skip when context.RouteData?.Values["bundle"] != null .

There is a solution for this? Maybe I did some misconfiguration?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Shazwazzacommented, Aug 23, 2021

I Just published a new 4.0 beta release with the [AllowAnonymous] change if you want to check it out

https://www.nuget.org/packages/Smidge/4.0.0-beta.357 https://www.nuget.org/packages/Smidge.Nuglify/4.0.0-beta.357

1reaction
Shazwazzacommented, Aug 23, 2021

So you are adding a global auth filter to all controllers which will include Smidge controllers and therefore the Smidge controllers will not execute.

A fix could be that we include the [AllowAnonymous] attribute on the smidge controller. I think this controller should always be publicly available since it’s just used for returning css/js.

You should be able to determine the current controller executing in your route values too and could just check for “Smidge” as the controller name and exclude your authz.

Let me know what you think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.0.0 Milestone
A lightweight runtime CSS/JavaScript file minification, combination, compression & management library for ASP.Net Core - 4.0.0 Milestone ...
Read more >
How to get ASP.NET MVC IAuthorizationFilter to respect ...
So I can navigate to /elmah to view my error logs. I have the following IgnoreRoute statements, so that MVC ignores the /elmah...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found