Open budcribar opened 4 years ago
@bartonjs could this be an issue in System.Security itself? @KrzysztofCwalina if this is an Azure issue, do you know who can take a look?
Ping @bartonjs @KrzysztofCwalina
Ping @bartonjs @KrzysztofCwalina
We just posted our plan for cryptographic support in Blazor/wasm apps in .NET 7 and beyond. See here for full details. That document also includes sample code demonstrating how to interop with the JS layer to get support for other algorithms (like HMACSHA256) which aren't supported out-of-the-box in Blazor/wasm in .NET 6.
Please use https://github.com/dotnet/runtime/issues/40074 for feedback on that document.
Thanks!
Issue Title
Microsoft.Azure.Documents.Client not supported in RC2
General
I am trying to access an Azure CMOS database from webassembly and getting the runtime error
"Unhandled exception rendering component: System.Security.Cryptography.Algorithms is not supported on this platform."
Missing this functionality limits the usefulness of Blazor since I cannot write directly into my Cosmos database using Microsoft.Azure.DocumentDB.Core and Microsoft.Azure.Cosmos
The full error trace is Unhandled exception rendering component: System.Security.Cryptography.Algorithms is not supported on this platform. System.PlatformNotSupportedException: System.Security.Cryptography.Algorithms is not supported on this platform. at System.Security.Cryptography.HMACSHA256..ctor(Byte[] key) at Microsoft.Azure.Documents.StringHMACSHA256Hash.ComputeHash(Byte[] bytesToHash) at Microsoft.Azure.Documents.AuthorizationHelper.GenerateKeyAuthorizationSignature(String verb, String resourceId, String resourceType, INameValueCollection headers, IComputeHash stringHMACSHA256Helper, String& payload) at Microsoft.Azure.Documents.AuthorizationHelper.GenerateKeyAuthorizationSignature(String verb, Uri uri, INameValueCollection headers, IComputeHash stringHMACSHA256Helper, String clientVersion) at Microsoft.Azure.Documents.Client.GatewayServiceConfigurationReader.GetDatabaseAccountAsync(Uri serviceEndpoint) at Microsoft.Azure.Documents.Routing.GlobalEndpointManager.GetDatabaseAccountFromAnyLocationsAsync(Uri defaultEndpoint, IListd__7[[CCWebSite.Controllers.Contact, BlazorWebSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() in C:\Users\budcr\source\repos\ChargeAndChange\BlazorWebSite\DocumentDBRepository.cs:line 77
at BlazorWebSite.Pages.Contacts.OnInitializedAsync() in C:\Users\budcr\source\repos\ChargeAndChange\BlazorWebSite\Pages\Contacts.razor:line 170
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
1 locations, Func
2 getDatabaseAccountFn) at Microsoft.Azure.Documents.Client.GatewayServiceConfigurationReader.InitializeReaderAsync() at Microsoft.Azure.Documents.Client.DocumentClient.InitializeGatewayConfigurationReader() at Microsoft.Azure.Documents.Client.DocumentClient.GetInitializationTask(IStoreClientFactory storeClientFactory) at Microsoft.Azure.Documents.Client.DocumentClient.EnsureValidClientAsync() at Microsoft.Azure.Documents.Client.DocumentClient.GetCollectionCacheAsync() at Microsoft.Azure.Documents.Query.DocumentQueryClient.Microsoft.Azure.Documents.Query.IDocumentQueryClient.GetCollectionCacheAsync() at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextFactory.CreateDocumentQueryExecutionContextAsync(IDocumentQueryClient client, ResourceType resourceTypeEnum, Type resourceType, Expression expression, FeedOptions feedOptions, String resourceLink, Boolean isContinuationExpected, CancellationToken token, Guid correlatedActivityId) at Microsoft.Azure.Documents.Linq.DocumentQuery1.<ExecuteNextPrivateAsync>d__37
1[[CCWebSite.Controllers.Contact, BlazorWebSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[CCWebSite.Controllers.Contact, BlazorWebSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at CCWebSite.Controllers.DocumentDBRepository`1.