abp
abp copied to clipboard
[Volo.Abp.Http.Client.IdentityModel] when used in blazor wasm app
I requested idenity server (AuthServer.Host), got exception as below.

- Your ABP Framework version.
- Your User Interface type (Angular/MVC/React... etc.) if the issue is related to a specific UI
- Your database provider(EF Core/MongoDB)
- Exception message and stack trace if available (check the logs).
- Steps needed to reproduce the problem.
Please write in English.
- Your ABP Framework version.
- Your User Interface type (Angular/MVC/React... etc.) if the issue is related to a specific UI
- Your database provider(EF Core/MongoDB)
- Exception message and stack trace if available (check the logs).
- Steps needed to reproduce the problem.
- Package version :4.2.0
- UI:Blzor wasm
- DatabaseProvider :EF Core
- Wasm console:
blazor.webassembly.js:1 System.PlatformNotSupportedException: System.Security.Cryptography.Algorithms is not supported on this platform. blazor.webassembly.js:1 at System.Security.Cryptography.MD5.Create() blazor.webassembly.js:1 at System.AbpStringExtensions.ToMd5(String str) blazor.webassembly.js:1 at Volo.Abp.IdentityModel.IdentityModelTokenCacheItem.CalculateCacheKey(IdentityClientConfiguration configuration) blazor.webassembly.js:1 at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.CalculateTokenCacheKey(IdentityClientConfiguration configuration) blazor.webassembly.js:1 at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenAsync(IdentityClientConfiguration configuration) blazor.webassembly.js:1 at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenOrNullAsync(String identityClientName) blazor.webassembly.js:1 at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.TryAuthenticateAsync(HttpClient client, String identityClientName) blazor.webassembly.js:1 at Volo.Abp.Http.Client.IdentityModel.IdentityModelRemoteServiceHttpClientAuthenticator.Authenticate(RemoteServiceHttpClientAuthenticateContext blazor.webassembly.js:1 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.d__42[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() blazor.webassembly.js:1 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor 1.<MakeRequestAndGetResultAsync>d__411[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null],[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto, Volo.Abp.AspNetCore.Mvc.Contracts, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() blazor.webassembly.js:1 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.<GetResultAsync>d__40[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() blazor.webassembly.js:1 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.d__39[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()`
Related: https://github.com/dotnet/runtime/issues/40074
You can try to override that method that uses MD5.
https://github.com/abpframework/abp/blob/3fcdeeeb05810b7a2e162f212ef435b81d412aa5/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs#L258
I will have a try.