Enx.OpenIddict.RavenDB
0.4.0
dotnet add package Enx.OpenIddict.RavenDB --version 0.4.0
NuGet\Install-Package Enx.OpenIddict.RavenDB -Version 0.4.0
<PackageReference Include="Enx.OpenIddict.RavenDB" Version="0.4.0" />
<PackageVersion Include="Enx.OpenIddict.RavenDB" Version="0.4.0" />
<PackageReference Include="Enx.OpenIddict.RavenDB" />
paket add Enx.OpenIddict.RavenDB --version 0.4.0
#r "nuget: Enx.OpenIddict.RavenDB, 0.4.0"
#:package Enx.OpenIddict.RavenDB@0.4.0
#addin nuget:?package=Enx.OpenIddict.RavenDB&version=0.4.0
#tool nuget:?package=Enx.OpenIddict.RavenDB&version=0.4.0
Enx.OpenIddict.RavenDB
RavenDB storage provider for OpenIddict — the flexible, standards-compliant OpenID Connect/OAuth 2.0 server framework for ASP.NET Core.
Overview
Enx.OpenIddict.RavenDB implements all four OpenIddict core store interfaces backed by RavenDB, enabling you to use a document-oriented database as the persistence layer for your OpenID Connect / OAuth 2.0 server.
| OpenIddict entity | Store implemented |
|---|---|
| Application | OpenIddictRavenDBApplicationStore<T> |
| Authorization | OpenIddictRavenDBAuthorizationStore<T> |
| Scope | OpenIddictRavenDBScopeStore<T> |
| Token | OpenIddictRavenDBTokenStore<T> |
Requirements
- .NET Standard 2.0 / 2.1, .NET 8, or .NET 10
- OpenIddict 7.x
- RavenDB.Client 7.x
Installation
dotnet add package Enx.OpenIddict.RavenDB
The models package is included transitively. If you need to reference the entity types directly in a separate project, add:
dotnet add package Enx.OpenIddict.RavenDB.Models
Getting started
1. Configure RavenDB
Register your RavenDB IDocumentStore as usual before configuring OpenIddict:
builder.Services.AddSingleton<IDocumentStore>(provider =>
{
var store = new DocumentStore
{
Urls = ["http://localhost:8080"],
Database = "MyApp"
};
store.Initialize();
return store;
});
// Register a scoped async session used by the OpenIddict stores
builder.Services.AddScoped(provider =>
provider.GetRequiredService<IDocumentStore>().OpenAsyncSession());
2. Register OpenIddict with the RavenDB provider
builder.Services.AddOpenIddict()
.AddCore(options =>
{
options.UseRavenDB();
})
.AddServer(options =>
{
// ... your server configuration
});
3. (Optional) Use static indexes
By default the stores rely on RavenDB auto-indexes. If you prefer pre-defined static indexes for better performance in production, enable the option and deploy the bundled indexes once at startup:
builder.Services.AddOpenIddict()
.AddCore(options =>
{
options.UseRavenDB(ravendb =>
{
ravendb.Configure(o => o.UseStaticIndexes = true);
});
});
var store = app.Services.GetRequiredService<IDocumentStore>();
await new ApplicationIndex<OpenIddictRavenDBApplication>().ExecuteAsync(store);
await new AuthorizationIndex<OpenIddictRavenDBAuthorization>().ExecuteAsync(store);
await new ScopeIndex<OpenIddictRavenDBScope>().ExecuteAsync(store);
await new TokenIndex<OpenIddictRavenDBToken>().ExecuteAsync(store);
If you are using custom entities, pass your types instead:
await new ApplicationIndex<MyApplication>().ExecuteAsync(store);
Custom entities
All entity types are extensible. Inherit from the base model, then tell OpenIddict to use your custom type:
public class MyApplication : OpenIddictRavenDBApplication
{
public string? Tenant { get; set; }
}
builder.Services.AddOpenIddict()
.AddCore(options =>
{
options.UseRavenDB(ravendb =>
{
ravendb.ReplaceDefaultApplicationEntity<MyApplication>();
});
});
The same pattern applies to ReplaceDefaultAuthorizationEntity<T>, ReplaceDefaultScopeEntity<T>, and ReplaceDefaultTokenEntity<T>.
Entity models
| Model | Key properties |
|---|---|
OpenIddictRavenDBApplication |
ApplicationType, ClientId, ClientSecret, ConsentType, DisplayName, DisplayNames, JsonWebKeySet, Permissions, PostLogoutRedirectUris, Properties, RedirectUris, Requirements, Settings, Type |
OpenIddictRavenDBAuthorization |
ApplicationId, CreationDate, Properties, Scopes, Tokens, Status, Subject, Type |
OpenIddictRavenDBScope |
Name, DisplayName, DisplayNames, Description, Descriptions, Properties, Resources |
OpenIddictRavenDBToken |
ApplicationId, AuthorizationId, CreationDate, ExpirationDate, Payload, Properties, RedemptionDate, ReferenceId, Status, Subject, Type |
Roadmap
The library is currently in pre-release. Version 1.0 will be published once end-to-end scenario tests (authorization code flow, client credentials, token introspection, etc.) are in place and passing.
Contributions to the test suite are especially welcome.
Contributing
Contributions are welcome. Please open an issue before submitting a pull request for significant changes.
License
This project is licensed under the MIT License. Copyright © 2026 Jean-François Pustay.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Enx.OpenIddict.RavenDB.Models (>= 0.4.0)
- OpenIddict.Core (>= 7.0.0 && < 8.0.0)
- RavenDB.Client (>= 7.0.0 && < 8.0.0)
-
.NETStandard 2.1
- Enx.OpenIddict.RavenDB.Models (>= 0.4.0)
- OpenIddict.Core (>= 7.0.0 && < 8.0.0)
- RavenDB.Client (>= 7.0.0 && < 8.0.0)
-
net10.0
- Enx.OpenIddict.RavenDB.Models (>= 0.4.0)
- OpenIddict.Core (>= 7.0.0 && < 8.0.0)
- RavenDB.Client (>= 7.0.0 && < 8.0.0)
-
net8.0
- Enx.OpenIddict.RavenDB.Models (>= 0.4.0)
- OpenIddict.Core (>= 7.0.0 && < 8.0.0)
- RavenDB.Client (>= 7.0.0 && < 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.