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
737 stars 99 forks source link

SCIM Sqlite support #785

Closed canea-asb closed 2 months ago

canea-asb commented 2 months ago

Sqlite support

This PR adds basic support for Sqlite in the SimpleIdServer.Scim.Host solution, specifically in the projects SimpleIdServer.Scim.Startup and SimpleIdServer.Scim.Persistence.EF.

Why?

My company has customer's with rules that might not allow us to create a regular database for the SCIM service. It is however allowed to store data in a Sqlite database, for some reason... That is why I would like support for Sqlite in SimpleIdServer. :)

How?

The main thing required to add support for Sqlite in SimpleIdServer SCIM was to re-implement the BulkUpdate and BulkDelete methods in src/Scim/SimpleIdServer.Scim.Persistence.EF/EFSCIMRepresentationCommandRepository.cs. I did this by creating a subclass of the existing CommandRepository called SqliteCompatible_EFSCIMRepresentationCommandRepository.

It was also necessary to add the initial migrations for Sqlite. Therefore I followed your pattern by creating a separate project for the Sqlite migration classes.

The last thing is that I changed the Program.cs file so that the user can use Sqlite by configuring the connection string to "Data Source=my.sqlite.db" and the "Type" attribute to be "SQLITE" in appsettings.json. Example configuration in appsettings.json:

"StorageConfiguration": {
  "ConnectionString": "Data Source=scim.db",
  "Type": "SQLITE"
}

One more change unrelated to Sqlite

In src/Scim/SimpleIdServer.Scim.Persistence.EF/Configurations/SCIMRepresentationAttributeConfiguration.cs I added a line that fixes the warning that shows up when starting the SimpleIdServer.Scim.Startup project

simpleidserver commented 2 months ago

@canea-asb : The pull request has been accepted! :) We've made significant progress in supporting FastFed OpenID with SCIM integration. A first working version will be available next week. You can follow the progress in the branch 'Ticket#781'