Skip to content

Blazor WASM logout results in 404 #35421

@skanva

Description

@skanva

Description

I have created a Blazor WASM app following the instructions from:
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-microsoft-entra-id?view=aspnetcore-9.0

I am using net9.0 and latest nuget packages.

For the configuration in wwwroot/appsettings.json I had to change the authority to this format:
"https://{TenantName}.ciamlogin.com/{TenantName}.onmicrosoft.com"
where {TenantName} is the name of my tenant.

When I run locally I can log in and log out successfully. But when I deploy this to Azure SWA, I can log in, but log out results in 404.

The browser url shows:
https://{my-swa-url}.azurestaticapps.net/authentication/logout-callback?state=52244933-59a1-4379-8dc0-e0f9a21db7ff

with page displaying:
404: Not Found
We couldn’t find that page, please check the URL and try again.

How can I resolve the log out issue so it successfully completes and returns user to site?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-microsoft-entra-id?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/security/webassembly/standalone-with-microsoft-entra-id.md

Document ID

7b99057a-a47c-c1a9-eaa8-4eeb792bed86

Platform Id

84b06c19-f447-5bb3-ac19-89d98dc3165f

Article author

@guardrex

Metadata

  • ID: 7b99057a-a47c-c1a9-eaa8-4eeb792bed86
  • PlatformId: 84b06c19-f447-5bb3-ac19-89d98dc3165f
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions