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

app works in dev; error when trying to access appstate #369

Open
rjean99 opened this issue Jan 22, 2024 · 2 comments
Open

app works in dev; error when trying to access appstate #369

rjean99 opened this issue Jan 22, 2024 · 2 comments

Comments

@rjean99
Copy link

rjean99 commented Jan 22, 2024

Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
Authorization failed. These requirements were not met:
DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

User can log in, but pizzas added before logging in are not restored and not re-directed to Checkout page

This is just happening from Azure, not in VS dev environment.

New to Blazor/.NET Core and not sure how to troubleshoot this.

https://blazingpizzaame.azurewebsites.net

@rjean99
Copy link
Author

rjean99 commented Jan 23, 2024

This is probably related. When I click log out this message appears and doesn't ever go away:

Processing logout callback...

Now I'm thinking that "DenyAnonymousAuthorizationRequirement: Requires an authenticated user" message doesn't mean anything related to these issues because I do see this in my dev tools console when running in debug, too, but everything seems to function OK.

@rjean99
Copy link
Author

rjean99 commented Jan 25, 2024

Backing up another step... Without a null check in RestorePizza, this error occurs in WASM. After adding a null check inside RestorePizza method, this error goes away but still have above behavior. So I can't tell if this is an appstate or authentication issue. And just to re-iterate, this only happens when running the deployment on Azure. Dev working OK. Maybe I'll try deploy to local IIS.

Unhandled exception rendering component: Arg_NullReferenceException
System.NullReferenceException: Arg_NullReferenceException
at BlazingPizza.Client.Pages.Authentication.RestorePizza(PizzaAuthenticationState pizzaState)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore1.<ProcessLogInCallback>d__86[[BlazingPizza.Client.PizzaAuthenticationState, BlazingPizza.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore1.d__84[[BlazingPizza.Client.PizzaAuthenticationState, BlazingPizza.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task , ComponentState )

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

1 participant