Cosmos.Identity 2.0.0

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

// Install Cosmos.Identity as a Cake Tool
#tool nuget:?package=Cosmos.Identity&version=2.0.0                

Cosmos.Identity

Cosmos DB provider for ASP.NET Core Identity framework

Build Project

NuGet Version

Coverage Status

Download

The Cosmos.Identity library is available on nuget.org via package name Cosmos.Identity.

To install Cosmos.Identity, run the following command in the Package Manager Console

PM> Install-Package Cosmos.Identity

More information about NuGet package available at https://nuget.org/packages/Cosmos.Identity

Usage

appsettings.json configuration

{
  "CosmosRepository": {
    "ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
    "DatabaseId": "SampleWebsite",
    "OptimizeBandwidth": false,
    "AllowBulkExecution": true
  }
}

Startup.cs

using Cosmos.Identity;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using IdentityRole = Cosmos.Identity.IdentityRole;
using IdentityUser = Cosmos.Identity.IdentityUser;

namespace Sample.Website
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCosmosRepository();

            services
                .AddIdentity<IdentityUser, IdentityRole>()
                .AddCosmosStores()
                .AddDefaultUI()
                .AddDefaultTokenProviders();

            services.AddRazorPages();
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
            });
        }
    }
}
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 is compatible.  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 was computed.  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
2.0.0 677 7/29/2023
1.1.60 961 12/22/2021
1.0.0.28 342 10/21/2021
1.0.0.14 527 7/9/2021
1.0.0.13 386 4/25/2021
1.0.0.12 332 4/22/2021
1.0.0.11 327 4/17/2021
1.0.0.10 396 3/11/2021
1.0.0.9 366 3/8/2021
1.0.0.8 327 3/5/2021
1.0.0.7 352 2/15/2021
0.1.0.1 349 2/14/2021