Community.OpenIddict.AmazonDynamoDB 3.2.0

dotnet add package Community.OpenIddict.AmazonDynamoDB --version 3.2.0
                    
NuGet\Install-Package Community.OpenIddict.AmazonDynamoDB -Version 3.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Community.OpenIddict.AmazonDynamoDB" Version="3.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Community.OpenIddict.AmazonDynamoDB" Version="3.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Community.OpenIddict.AmazonDynamoDB" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Community.OpenIddict.AmazonDynamoDB --version 3.2.0
                    
#r "nuget: Community.OpenIddict.AmazonDynamoDB, 3.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Community.OpenIddict.AmazonDynamoDB@3.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Community.OpenIddict.AmazonDynamoDB&version=3.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Community.OpenIddict.AmazonDynamoDB&version=3.2.0
                    
Install as a Cake Tool

OpenIddict.AmazonDynamoDB

Build Status codecov NuGet

A DynamoDB integration for OpenIddict, targeting .NET 8, 9 and 10.

Getting Started

You can install the latest version via Nuget:

> dotnet add package Community.OpenIddict.AmazonDynamoDB

Then you use the stores by calling UseDynamoDb on OpenIddictCoreBuilder:

services
    .AddOpenIddict()
    .AddCore(options => {
        options.UseDynamoDb()
            .Configure(options =>
            {
                options.BillingMode = BillingMode.PROVISIONED; // Default is BillingMode.PAY_PER_REQUEST
                options.ProvisionedThroughput = new ProvisionedThroughput
                {
                    ReadCapacityUnits = 5, // Default is 1
                    WriteCapacityUnits = 5, // Default is 1
                };
                options.DefaultTableName = "CustomOpenIddictTable"; // Default is openiddict
            });
    }); 

Finally, you need to ensure that tables and indexes have been added:

OpenIddictDynamoDbSetup.EnsureInitialized(serviceProvider);

Or asynchronously:

await OpenIddictDynamoDbSetup.EnsureInitializedAsync(serviceProvider);

The table is created if it doesn't exist, and time to live is enabled on the ttl attribute so that expired and revoked tokens and authorizations are removed. If the table already exists, any global secondary index that is missing from it is added (and the Resource-index from tables created before scopes were stored with lookups is replaced by ScopeId-index), and the call waits until the indexes are active. New indexes use provisioned throughput from the options when the existing table is provisioned, and on-demand capacity otherwise. It's safe to call from several instances at the same time.

The call needs the dynamodb:DescribeTable and dynamodb:DescribeTimeToLive permissions on the table, plus dynamodb:CreateTable to create it, dynamodb:UpdateTable to change its indexes and dynamodb:UpdateTimeToLive to enable time to live. Without dynamodb:DescribeTable it falls back to dynamodb:ListTables and only checks that the table exists. If an index or time to live can't be changed because a permission is missing, a warning is logged instead of failing.

The IServiceProvider overloads log progress and warnings through the registered ILoggerFactory.

Concurrency

Updates to applications, authorizations, scopes and tokens only succeed if the item hasn't been changed since it was loaded, otherwise an OpenIddictExceptions.ConcurrencyException is thrown, as with the Entity Framework Core stores. This is what makes sure that authorization codes and refresh tokens can only be redeemed once when several requests redeem them at the same time.

Lifetime

Tokens and authorizations are removed by DynamoDB's time to live. Tokens are kept until they expire, and until five minutes after they have been redeemed or revoked. Ad-hoc authorizations are kept until the last of their tokens expires, and permanent authorizations until they are revoked. DynamoDB usually removes expired items within a few days.

Tests

In order to run the tests, you need to have DynamoDB running locally on localhost:8000. This can easily be done using Docker and the following command:

docker run -p 8000:8000 amazon/dynamodb-local
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2.0 351 10/1/2026
3.1.0 1,684 10/28/2025
3.0.0 1,958 2/2/2025
2.2.1 918 7/8/2024
2.2.0 438 3/23/2024
2.1.0 1,760 1/21/2024
2.0.2 608 11/10/2023
2.0.1 244 10/29/2023
2.0.0 250 10/29/2023
1.0.3 246 10/28/2023
1.0.2 859 5/15/2023
1.0.1 744 1/28/2023
1.0.0 569 1/9/2023
0.1.4 655 10/16/2022
0.1.3 625 10/5/2022
0.1.2 568 10/5/2022
0.1.1 544 10/2/2022
0.1.0 574 10/2/2022