dewijones92
dewijones92

Reputation: 1359

How do I avoid using Microsofts's Microsoft.AspNet.Identity package when using openiddict

I am following this brilliant tutorial http://capesean.co.za/blog/asp-net-5-jwt-tokens/
It works perfectly. The problem is, is that I want to use my own user management code to validate the given username, password to retrieve an access token and refresh token.
This tutorial (and the samples on https://github.com/openiddict/openiddict-core/tree/dev/samples) use the proprietary Asp.net Identity library
How would I configure the configuration given in the Startup.cs class to use my own User Managment code?
For example....

var user = _repo.getUsers().Where(u => u.username == req.username && req.password == u.password).FirstOrDefault();and password against whatever system you wish.
            return getAuthToken(user);  

Thanks

Upvotes: 0

Views: 331

Answers (1)

Kévin Chalet
Kévin Chalet

Reputation: 42100

Edit: as of beta1, OpenIddict no longer depends on ASP.NET Identity, though it's still the recommended membership stack.


TL;DR: you can't.

OpenIddict has been specially designed to use ASP.NET Identity's abstractions and cannot be used independently.

When using your own membership stack, I recommend using ASOS, the OpenID Connect server middleware behind OpenIddict: it doesn't depend on a particular implementation and offers full flexibility.

Here's how you could implement the resource owner password credentials grant with ASOS beta4 (for ASP.NET 5 RC1): https://stackoverflow.com/a/30857524/542757.

Upvotes: 1

Related Questions