I’ve upgraded my project from ABP v8.1.0 to v8.2.2. Backend works well but there is a problem in Blazor side. I’m using a custom AuthenticationProvider as the sample of https://github.com/realLiangshiwei/Qa2664.
After upgrading, I noticed some differences related to authentication, but I haven’t been able to resolve the issue.
- Blazor (wasm) now makes a request to backend/.well-known/openid-configuration, which wasn’t present in version 8.1.0.
- I’m seeing the following warning in the console:
“warn: Volo.Abp.IdentityModel.IdentityModelAuthenticationService[0] Could not find IdentityClientConfiguration for Default. Either define a configuration for Default or set a default configuration.” - The new version of Blazor is creating local storage objects with key names that start with “oidc…”.
- I’m making HTTP requests to the /token endpoint to retrieve access_token and refresh_token. Even though I successfully store them in local storage, the new Blazor version doesn’t seem to recognize them. It fails to log me into the panel and redirects me to the index page in NotAuthorized view.
I’ve been using custom AuthenticationProvider for about 2 years, but it doesn’t work after 8.2.2.
Finally, found the solution. I’ve added registration code to Program.cs, instead of BlazorModule.cs
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthStateProvider>();