Replies: 3 comments
-
|
Update on this item... The Pomelo.EntityFrameworkCore.MySql does not fully support the auto mapping of string[] properties to JSON. Although it does have some JSON support it does not support the EF Core ToJson() method, which is what .NET Identity uses to configure the Passkey entity: This means that even when Pomelo.EntityFrameworkCore.MySql releases a .NET 10 version, it will not resolve the problem I described above of "The property 'IdentityPasskeyData.Transports' could not be mapped because it is of type 'string[]'". I do not think it is reasonable to restrict ALL Oqtane users from using MySQL simply because of this .NET Identity Passkey limitation (which is not even enabled by default in a standard Oqtane installation). So we will need to figure out a way to work around it. I believe it may be possible to set the options.Stores.SchemaVersion programmatically based on the type of database (ie. within OnConfiguring() for the TenantDBContext). It can be set to Version3 by default... or Version2 if the site is using MySQL. And since there is already a feature flag in User Management / Settings for "Allow PassKeys?" (default to No) then it should be as simple as not allowing users to enable the feature if they are using MySQL. In theory this would allow us to migrate back to MySql.EntityFrameworkCore (which has an RC release available for .NET 10) which would allow Oqtane 10 to support MySQL. |
Beta Was this translation helpful? Give feedback.
-
|
The Passkey issue with the .NET Identity provider and MySQL has been logged here: |
Beta Was this translation helpful? Give feedback.
-
|
#5944 restores MySQL support to Oqtane 10... by transitioning to the MySql.EntityFrameworkCore provider and disabling .NET Identity Passkeys (when running on MySQL) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Oqtane uses the Pomelo.EntityFrameworkCore.MySql database provider for MySQL support, however there is not yet an official release of the Pomelo provider for .NET 10:
PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#2007
Previously Oqtane used the MySql.EntityFrameworkCore provider, however there were compatibility issues encountered in .NET 9:
#4954
As a result we transitioned to the the Pomelo.EntityFrameworkCore.MySql provider:
#4987
There is an RC version of the MySql.EntityFrameworkCore provider available for .NET 10
https://www.nuget.org/packages/MySql.EntityFrameworkCore/#versions-body-tab
An attempt was made to transition Oqtane back to MySql.EntityFrameworkCore however this resulted in an issue with the new Passkey capability in .NET Identity in .NET 10 which uses a string[] property in its model class:
The property 'IdentityPasskeyData.Transports' could not be mapped because it is of type 'string[]', which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.ValidatePropertyMapping(IConventionTypeBase structuralType, IConventionModel model, IDiagnosticsLogger
1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.ValidatePropertyMapping(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at MySql.EntityFrameworkCore.Internal.MySQLModelValidator.Validate(IModel model, IDiagnosticsLogger`1 logger)This is a blocker to using the MySql.EntityFrameworkCore provider. This issue has been raised to Microsoft. This will not be an issue with the Pomelo provider as it natively supports mapping string[] properties to JSON. So we will have to continue to be patient and wait for the Pomelo.EntityFrameworkCore.MySql provider to become available.
Beta Was this translation helpful? Give feedback.
All reactions