-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ICurrentUser.IsAuthenticated = false on Blazor WASM after upgrade to 8.2 RC3 #19965
Comments
I am experiencing same issue with ABP version 8.1.1. Specifically, CurrentUser.IsAuthenticated always returns false. |
hi Please create a template project and compare the |
`using GFCAPI.EntityFrameworkCore; namespace GFCAPI.Web; [DependsOn(
} |
hi Why does your module depend on |
Update: I've tried to map all of the code from the startup template for the authserver and httpapi.host modules, and the issue still exists. I am going to try and upgrade one of my other test solutions that also has subdomain tenant resolution to see if I can create a repro that I can share. |
Further update:
My main solution is a lot more complex than the startup template, with additional modules, custom theme, etc. I fear this may be a case of trial and error, removing / changing components in my main solution until I find the culprit. I will report back once I do. In the meantime are there any pointers of what kind of situation might cause this, or any areas where you would recommend looking to try and find what is happening? |
OK, finally found the issue: Upon further inspection of the application traces, the tokens were being rejected as invalid: "IDX14100: JWT is not well formed, there are no dots (.). The token needs to be in JWS or JWE Compact Serialization Format. (JWS)" This is the same as reported in #19893 and dotnet/aspnetcore#52286 The reason this worked in the new solution but not in my older one was because these three packages were missing from the httpapi.host csproj file on my older, upgraded solution:
Per the reported issue, adding these seems to overcome some problems in the way that the MS libraries validate the tokens. |
Is there an existing issue for this?
Description
Following upgrade of my Blazor WASM solution from 8.0 to 8.2 RC3, I am encountering an issue with authentication.
I am using subdomain tenant resolution, including on the Blazor WASM app.
I am logging into a tenant (also tried using the host) via the admin account.
I can login just fine, but after login and the redirect back to Blazor, the ICurrentUser's IsAuthenticated is set to false and any post-auth content accordingly cannot be viewed.
In app.razor:
@context.User.Identity?.IsAuthenticated = returns true (context refers to AuthenticationState)
Also, claims can be printed out for the user.
@currentUser.IsAuthenticated = returns false (as does CurrentPrincipalAccessor)
Claims for the user are empty and the user's properties are null.
I thought this might be related to #18552 but adding the line suggested to my httpapi.host project in that issue does not resolve the issue:
If I try the other solution in the identityserver module in preconfigureservices, I get an error:
The database migrations have been applied and the normalised tenancy names applied to existing tenants per the migration guide. DBMigrator has been run after upgrading.
The AuthServer site's page shows the user logged in as expected.
Is there anything else which has changed between 8.0 and 8.2 RC3 which I should check?
Reproduction Steps
No response
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.2 RC3
User Interface
Blazor
Database Provider
EF Core (Default)
Tiered or separate authentication server
Separate Auth Server
Operation System
Windows (Default)
Other information
No response
The text was updated successfully, but these errors were encountered: