Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JudahGabriel/RavenDB.AspNet.Identity
ASP.NET Identity provider that uses RavenDB for storage of users and logins.
https://github.com/JudahGabriel/RavenDB.AspNet.Identity
asp-net-identity ravendb
Last synced: 7 days ago
JSON representation
ASP.NET Identity provider that uses RavenDB for storage of users and logins.
- Host: GitHub
- URL: https://github.com/JudahGabriel/RavenDB.AspNet.Identity
- Owner: JudahGabriel
- License: apache-2.0
- Created: 2013-10-24T19:57:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T21:09:52.000Z (almost 6 years ago)
- Last Synced: 2024-10-05T20:45:53.390Z (about 1 month ago)
- Topics: asp-net-identity, ravendb
- Language: C#
- Homepage: https://www.nuget.org/packages/RavenDB.AspNet.Identity/
- Size: 7.74 MB
- Stars: 51
- Watchers: 18
- Forks: 24
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RavenDB.AspNet.Identity #
RavenDB identity provider for ASP.NET MVC 5+ and Web API 2+. (Looking for .NET Core identity provider for RavenDB? Check out our [sister project, RavenDB.Identity](https://github.com/JudahGabriel/RavenDB.Identity).)We're on [NuGet as RavenDB.AspNet.Identity](https://www.nuget.org/packages/RavenDB.AspNet.Identity/).
## Instructions ##
1. Create a new ASP.NET MVC 5 project, choosing the Individual User Accounts authentication type.
2. Remove the Entity Framework packages and replace with RavenDB Identity:
* Uninstall-Package Microsoft.AspNet.Identity.EntityFramework
* Uninstall-Package EntityFramework
* Install-Package RavenDB.AspNet.Identity
3. In ~/Models/IdentityModels.cs:
* Remove the namespace: Microsoft.AspNet.Identity.EntityFramework
* Add the namespace: Raven.AspNet.Identity
* Remove the entire ApplicationDbContext class. You don't need that!
4. In ~/App_Start/IdentityConfig.cs
* Update the ApplicationUserManager.Create method to get the Raven document session.
```csharp
public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore(context.Get()));
...
}
```
5. In ~/App_Start/Startup.Auth.cs:
* Remove the Entity framework context and add a RavenDB context:
```csharp
// Old: app.CreatePerOwinContext(ApplicationDbContext.Create);
// New. The raven variable is your Raven DocumentStore singleton.
app.CreatePerOwinContext(() => raven.OpenAsyncSession());
```
6. Add a RavenController.cs class.
* This will save changes on the document session if the controller action executed successfully.
* You can [view the RavenController.cs sample](https://github.com/JudahGabriel/RavenDB.AspNet.Identity/blob/master/Sample/Controllers/RavenController.cs).
7. Make AccountController.cs inherit from RavenController
```csharp
public class AccountController : RavenController
{
...
}
```