AspNetCore.Identity.AmazonDynamoDB 1.1.3

dotnet add package AspNetCore.Identity.AmazonDynamoDB --version 1.1.3
NuGet\Install-Package AspNetCore.Identity.AmazonDynamoDB -Version 1.1.3
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="AspNetCore.Identity.AmazonDynamoDB" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AspNetCore.Identity.AmazonDynamoDB --version 1.1.3
#r "nuget: AspNetCore.Identity.AmazonDynamoDB, 1.1.3"
#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.
// Install AspNetCore.Identity.AmazonDynamoDB as a Cake Addin
#addin nuget:?package=AspNetCore.Identity.AmazonDynamoDB&version=1.1.3

// Install AspNetCore.Identity.AmazonDynamoDB as a Cake Tool
#tool nuget:?package=AspNetCore.Identity.AmazonDynamoDB&version=1.1.3

AspNetCore.Identity.AmazonDynamoDB

Build Status codecov NuGet

An ASP.NET Core Identity 8.0 provider for DynamoDB.

Getting Started

You can install the latest version via Nuget:

> dotnet add package AspNetCore.Identity.AmazonDynamoDB

Then you use the stores by calling AddDynamoDbStores on IdentityBuilder:

services
    .AddIdentityCore<DynamoDbUser>()
    .AddRoles<DynamoDbRole>()
    .AddDynamoDbStores()
    .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 = "my-custom-identity-table-name"; // Default is identity
    });

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

DynamoDbSetup.EnsureInitialized(serviceProvider);

Or asynchronously:

await AspNetCoreIdentityDynamoDbSetup.EnsureInitializedAsync(serviceProvider);

Tests

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

Adding Attributes

To add custom attributes to the user or role model, you would need to create a new class that extends the DynamoDbUser or DynamoDbRole and adds the needed additional attributes.

public class CustomUser : DynamoDbUser
{
    public string? ProfilePictureUrl { get; set; }
}

Then you need to use your new classes when adding the DynamoDB stores:

services
    .AddIdentityCore<CustomUser>()
    .AddRoles<CustomRole>()
    .AddDynamoDbStores();
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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
1.1.3 204 3/23/2024
1.1.2 164 1/22/2024
1.1.1 84 1/21/2024
1.1.0 204 11/27/2023
1.0.2 367 10/29/2023
1.0.1 1,085 1/28/2023
1.0.0 358 1/6/2023
0.2.0 399 10/15/2022
0.1.3 365 10/5/2022
0.1.2 344 10/5/2022
0.1.1 333 10/2/2022
0.1.0 331 10/2/2022