Allow anonymous access to certain areas of my application

Hi all,
I’ve spent the last few hours trying to figure out how I can allow anonymous access on targeted area of my application (built with .NET 6 / Blazor) - with no success.

The authentication part has been working fine for the past few months since we went live, however we need to add a “public” area where non authenticated users are able to navigate part of our web based application without being forced to create a user and/or authenticate.

I was hoping that there is a way of configuring the application in a way that - for example - for certain urls we do not redirect the users to the login area but I can’t find anything useful on neither the documentation nor the community posts. Am I missing something?

Thank you

Hi @vincenzo.scalera,

Welcome to the Auth0 Community!

I don’t know much about Blazor, but after a quick look at their docs it seems this is the job of the [Authorize] attribute.

In our example: secure-blazor-wasm-quiz-manager/Client/Pages at master · auth0-blog/secure-blazor-wasm-quiz-manager · GitHub, you can see the attribute is added to the QuizViewer page.

Hope that helps!

1 Like

Hey Dan thanks a lot for the quick reply
And yes that’s exactly it! I should have dug a bit more into the MS documentation

By removing the Authorize attribute from the pages I want to make public, they are not forced through to the authorization process.

Thank you

1 Like

No problem! Let us know if you have any other questions.