Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yetanotherchris/marten.aspnetidentity
Marten implementation of Microsoft.AspNetCore.Identity
https://github.com/yetanotherchris/marten.aspnetidentity
aspnet-core aspnetcore aspnetcoreidentity aspnetcoremvc marten
Last synced: 18 days ago
JSON representation
Marten implementation of Microsoft.AspNetCore.Identity
- Host: GitHub
- URL: https://github.com/yetanotherchris/marten.aspnetidentity
- Owner: yetanotherchris
- License: mit
- Created: 2018-06-13T19:15:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T13:00:07.000Z (2 months ago)
- Last Synced: 2024-12-03T22:03:48.732Z (about 1 month ago)
- Topics: aspnet-core, aspnetcore, aspnetcoreidentity, aspnetcoremvc, marten
- Language: C#
- Size: 548 KB
- Stars: 21
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![NuGet](https://img.shields.io/nuget/dt/Marten.AspNetIdentity.svg)](https://www.nuget.org/packages/Marten.AspNetIdentity/)
# MartenAspNetIdentity
MartenAspNetIdentity is a [Marten DocumentDb](http://jasperfx.github.io/marten/) implementation of [Microsoft.AspNetCore.Identity](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity?view=aspnetcore-2.1).
## Example usage
```
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddLogging();string connectionString = "server=localhost;database=aspnetidentity;uid=aspnetidentity;pwd=aspnetidentity;";
services.AddIdentity()
.AddMartenStores(connectionString)
.AddDefaultTokenProviders();// more service wireup...
}
```* `ApplicationUser` is your user class to store.
* `IdentityRole` is the role to store.This will create an `IDocumentStore` for you, create a database and using the connection string provided, and add it to your services. If you already have an `IDocumentStore` configured in your DI container, you can use the overload without the connection string, the MartenAspNetIdentity will use this for its managers:
```
services.AddIdentity()
.AddMartenStores()
.AddDefaultTokenProviders();
```There is a full example in this repository under the [Example project](https://github.com/roadkillwiki/Marten.AspNetIdentity/tree/master/src/Marten.AspNetIdentity.Example)