Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loresoft/cosmos.identity
Cosmos DB provider for ASP.NET Core Identity framework
https://github.com/loresoft/cosmos.identity
cosmos cosmosdb documentdb identity identity-framework
Last synced: 21 days ago
JSON representation
Cosmos DB provider for ASP.NET Core Identity framework
- Host: GitHub
- URL: https://github.com/loresoft/cosmos.identity
- Owner: loresoft
- License: mit
- Created: 2021-01-15T17:04:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T02:19:48.000Z (about 1 month ago)
- Last Synced: 2024-12-10T11:44:39.497Z (24 days ago)
- Topics: cosmos, cosmosdb, documentdb, identity, identity-framework
- Language: C#
- Homepage:
- Size: 771 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Cosmos.Identity
Cosmos DB provider for ASP.NET Core Identity framework[![Build Project](https://github.com/loresoft/Cosmos.Identity/actions/workflows/dotnet.yml/badge.svg)](https://github.com/loresoft/Cosmos.Identity/actions/workflows/dotnet.yml)
[![NuGet Version](https://img.shields.io/nuget/v/Cosmos.Identity.svg?style=flat-square)](https://www.nuget.org/packages/Cosmos.Identity/)
[![Coverage Status](https://coveralls.io/repos/github/loresoft/Cosmos.Identity/badge.svg?branch=main)](https://coveralls.io/github/loresoft/Cosmos.Identity?branch=main)
## 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## Usage
appsettings.json configuration
```json
{
"CosmosRepository": {
"ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"DatabaseId": "SampleWebsite",
"OptimizeBandwidth": false,
"AllowBulkExecution": true
}
}
```Startup.cs
```c#
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()
.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();
});
}
}
}
```