Skip to content

Blazor Authenticate Exception_wasthrown #59137

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

Closed
1 task done
hannespreishuber opened this issue Nov 25, 2024 · 6 comments
Closed
1 task done

Blazor Authenticate Exception_wasthrown #59137

hannespreishuber opened this issue Nov 25, 2024 · 6 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-authentication investigate Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity

Comments

@hannespreishuber
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I migrate a blazor 8 to 9 with SSR and Authentication. As I stuck with issues (eg infinit reload of login) I created a new Blazor Project
Template Blazor Web App, drop down Server per Page
Image
create Database
try to create User
fail with exception in Identityredirectmanager.cs
Image

Expected Behavior

working default Visual Studio Template

Steps To Reproduce

see above

Exceptions (if any)

Image

.NET Version

9.0.100

Anything else?

No response

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Nov 25, 2024
@mkArtakMSFT
Copy link
Contributor

Thanks for contacting us. The exception that you're observing is going to be handled by the framework. It's just a debugger behavior change that is causing the break, which you can safely continue. We're going to improve this experience in the upcoming .NET 9 servicing release. You can learn more about this from the PR description: #58573

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@mkArtakMSFT
Copy link
Contributor

As for the redirection cycle that you've observed, that usually is experience when there is a mismatch between the authentication states between the server and the client, which leads to the client to try to redirect to the server for authentication, which in turn, thinking that the user is authenticated, redirects the user back to the page where all this started from. So the cycle repeats.

If you aren't able to figure out the cause for the mismatch, feel free to share a minimal repro project and we can take a look.

@mkArtakMSFT mkArtakMSFT reopened this Nov 25, 2024
@mkArtakMSFT mkArtakMSFT added Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue feature-authentication labels Nov 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Nov 25, 2024
@hannespreishuber
Copy link
Author

it is just click click click project

https://github.com/[hannespreishuber/BlazorApp2GlobalAuthDeleteMe](https://github.com/hannespreishuber/BlazorApp2GlobalAuthDeleteMe)

create Database- run
Create a user account - Exception

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Nov 25, 2024
@javiercn
Copy link
Member

@hannespreishuber the exception is expected.

The framework catches it. The debugger is simply stopping on it, if you run without debugging, the debugger shouldn't break on the exception, and you should be able to execute without pause.

Do you still see an issue when you run without debugging? (Exception and/or login cycle).

@javiercn javiercn added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Nov 26, 2024
Copy link
Contributor

Hi @hannespreishuber. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@javiercn javiercn removed the Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue label Nov 26, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components feature-authentication investigate Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity
Projects
None yet
Development

No branches or pull requests

3 participants