abp icon indicating copy to clipboard operation
abp copied to clipboard

[Volo.Abp.Http.Client.IdentityModel] when used in blazor wasm app

Open galosys opened this issue 5 years ago • 5 comments

I requested idenity server (AuthServer.Host), got exception as below.

image

galosys avatar Feb 01 '21 12:02 galosys

  • 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.

maliming avatar Feb 01 '21 12:02 maliming

  • 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.DynamicHttpProxyInterceptor1.<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()`

galosys avatar Feb 01 '21 12:02 galosys

Related: https://github.com/dotnet/runtime/issues/40074

maliming avatar Feb 01 '21 13:02 maliming

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

maliming avatar Feb 01 '21 14:02 maliming

I will have a try.

galosys avatar Feb 01 '21 23:02 galosys