simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
686 stars 90 forks source link

[question]Do you support other databases #611

Closed qq1176914912 closed 8 months ago

qq1176914912 commented 8 months ago

Does the database support other databases besides SqlServer? How to change the database type used by the program if supported?

simpleidserver commented 8 months ago

Hello,

By default, SimpleIdServer supports two databases: SQLSERVER and POSTGRESQL. For more information, you can refer to the documentation: https://simpleidserver.com/docs/iam/storage

Of course, it is possible to support other database providers. You can find a list here: https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli

To support your preferred database, please follow these steps:

  1. Create project named IdServer with the SimpleIdServer.IdServer Package.
dotnet new idserver -n IdServer --storageConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True" --distributedCacheConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True"
  1. Navigate to the directory IdServer and install the appropriate Nuget package for example Microsoft.EntityFrameworkCore.Sqlite for SQLite.
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
  1. Open the Program.cs file in your preferred text editor.
  2. Edit the ConfigureStorage method and configure SQLITE :
b.UseSqlite("CONNECTIONSTRING", o =>
{
    o.MigrationsAssembly("IdServer");
    o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
});
  1. Edit the ConfigureDistributedCache method and configure your distributed caching storage. Please refer to the official documentation here: https://learn.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-7.0. If you want to use the InMemory implementation, you can comment out the content.
  2. Run the following command line to create the migrations scripts
  3. Run the project

The documentation will be updated in future releases to explain in more detail how to configure your storage. If you need support with your configuration, don't hesitate to contact us.

KR,

SID

qq1176914912 commented 8 months ago

Hello,

By default, SimpleIdServer supports two databases: SQLSERVER and POSTGRESQL. For more information, you can refer to the documentation: https://simpleidserver.com/docs/iam/storage

Of course, it is possible to support other database providers. You can find a list here: https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli

To support your preferred database, please follow these steps:

  1. Create project named IdServer with the SimpleIdServer.IdServer Package.
dotnet new idserver -n IdServer --storageConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True" --distributedCacheConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True"
  1. Navigate to the directory IdServer and install the appropriate Nuget package for example Microsoft.EntityFrameworkCore.Sqlite for SQLite.
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
  1. Open the Program.cs file in your preferred text editor.
  2. Edit the ConfigureStorage method and configure SQLITE :
b.UseSqlite("CONNECTIONSTRING", o =>
{
    o.MigrationsAssembly("IdServer");
    o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
});
  1. Edit the ConfigureDistributedCache method and configure your distributed caching storage. Please refer to the official documentation here: https://learn.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-7.0. If you want to use the InMemory implementation, you can comment out the content.
  2. Run the following command line to create the migrations scripts
  3. Run the project

The documentation will be updated in future releases to explain in more detail how to configure your storage. If you need support with your configuration, don't hesitate to contact us.

KR,

SID

Okay, I understand. Thank you for your reply.

qq1176914912 commented 7 months ago

Hello,

By default, SimpleIdServer supports two databases: SQLSERVER and POSTGRESQL. For more information, you can refer to the documentation: https://simpleidserver.com/docs/iam/storage

Of course, it is possible to support other database providers. You can find a list here: https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli

To support your preferred database, please follow these steps:

  1. Create project named IdServer with the SimpleIdServer.IdServer Package.
dotnet new idserver -n IdServer --storageConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True" --distributedCacheConnectionString "Data Source=.;Initial Catalog=IdServer;Integrated Security=True;TrustServerCertificate=True"
  1. Navigate to the directory IdServer and install the appropriate Nuget package for example Microsoft.EntityFrameworkCore.Sqlite for SQLite.
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
  1. Open the Program.cs file in your preferred text editor.
  2. Edit the ConfigureStorage method and configure SQLITE :
b.UseSqlite("CONNECTIONSTRING", o =>
{
    o.MigrationsAssembly("IdServer");
    o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
});
  1. Edit the ConfigureDistributedCache method and configure your distributed caching storage. Please refer to the official documentation here: https://learn.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-7.0. If you want to use the InMemory implementation, you can comment out the content.
  2. Run the following command line to create the migrations scripts
  3. Run the project

The documentation will be updated in future releases to explain in more detail how to configure your storage. If you need support with your configuration, don't hesitate to contact us.

KR,

SID

I want to use POSTGRESQL in the project 'SimpleIdServer. IdServer. Startup', and I have changed the Type of 'appsettings. json' as follows: image After the result is started, an error is reported as follows: image This issue seems to be due to the fact that 'DistributedCacheConfiguration' does not support postgreSQL. In your document‘ https://simpleidserver.com/docs/iam/configuration ’When it comes to postgreSQL, the value is actually SQLSERVER