Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllowAnonymous does not work #16

Closed
franky1017 opened this issue Jun 20, 2024 · 4 comments
Closed

AllowAnonymous does not work #16

franky1017 opened this issue Jun 20, 2024 · 4 comments

Comments

@franky1017
Copy link

I created a simple page in my BlazorApp (InteractiveAuto) and set it to be public. Here is the simple code:

`@page "/test"
@attribute [AllowAnonymous]

<h3>Test</h3>

@code {

}

The page loads briefly with the word "Test" on the page but then redirected to the login page. I couldn't figure out why. Can you provide some guidance as how I can create public pages that do not require authentication/authorization?

By the way, I created these pages in both the server app and the client app, same.

Thanks!

@YuriyDurov
Copy link
Member

Hello @franky1017

For guidance on Blazor authentication capabilities, refer to Blazor documentation on the topic.

Normally in a Blazor application pages are available to unauthenticated users by default, unless you mark the page with an [Authorize] attribute.

@franky1017
Copy link
Author

franky1017 commented Jun 21, 2024 via email

@YuriyDurov
Copy link
Member

@franky1017

It seems like something may be interfering with your Blazor request pipeline. Try creating a new Blazor project and then following the steps from Blazor.Auth documentation and see if it works for you.

Also, I can take a look at your solution if you attach it to this issue.

@franky1017
Copy link
Author

franky1017 commented Jun 22, 2024 via email

@YuriyDurov YuriyDurov closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants