-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Regression, Blazor WASM OIDC login callback to not sent to the requested page when published #44973
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
Comments
@aguacongas thanks for contacting us. You need to call NavigateToLogin here. We updated our support to stop relying on the query string. |
See aspnet/Announcements#497 for details. |
@javiercn THX |
@gewarren The doc is not yet updated here https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-authentication-library?view=aspnetcore-7.0&tabs=visual-studio#redirecttologin-component, Is it normal ? |
Thanks for letting me know. I have a PR to update it here: dotnet/AspNetCore.Docs#27562. |
@javiercn Sorry but I reopen because it doesn't work when app is published in release. I updated the title and steps to reproduce |
@aguacongas can you make sure that your browser is not doing any caching?
Nevermind, I reproed it. |
@javiercn I opened it InPrivate mode so pretty sure there's no cache. And it work when the app is running in Debug |
It's something to do with trimming |
@javiercn I guess the resolved status should be removed |
Ok, so this turned out to be a linker issue |
I disabled linking for this assembly doing what you mention in #44854 (comment) ; Add this to your csproj <ItemGroup>
<TrimmerRootDescriptor Include="TrimmerRootDescriptor.xml" />
</ItemGroup> And this is TrimmerRootDescriptor.xml: <?xml version="1.0" encoding="UTF-8" ?>
<linker>
<assembly fullname="Microsoft.AspNetCore.Components.WebAssembly.Authentication" preserve="all" />
</linker> And it workarounds this issue |
Has this been resolved with 7.0.1? |
@vanillajonathan yes, this was addressed in 7.0.1 as part of #45028 |
Is there an existing issue for this?
Describe the bug
On login callback, the requested protected page should be display if the user has authorization. It was the case with .Net 6
Expected Behavior
The requested protected page should be display if the user has authorization
Steps To Reproduce
Using the code in the repo aguacongas/BlazorAuthIssue. It's a simple blazor wasm starter with OIDC authentication.
dotnet publish -c Release
.\BlazorAuthIssue.Server.exe --urls http://localhost:5001
Exceptions (if any)
No response
.NET Version
7.0.0
Anything else?
ASP.NET Core version: 7.0.0
The text was updated successfully, but these errors were encountered: