LLBLGen for .NET Core Identity

Posts   
 
    
larkydoo
User
Posts: 45
Joined: 30-Jun-2008
# Posted on: 30-Apr-2018 16:02:08   

Is there still no port of .NET Core Identity into LLBLGen Pro?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 30-Apr-2018 16:38:58   

what is .NET core identity exactly? You mean identity server?

Frans Bouma | Lead developer LLBLGen Pro
larkydoo
User
Posts: 45
Joined: 30-Jun-2008
# Posted on: 30-Apr-2018 16:42:24   

Sorry, ASP.NET Core Identity. Microsoft's membership system.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 30-Apr-2018 17:26:35   

If you mean implementing the logic inside the ASP.NET membership Stored Procedures in code using LLBLGen framework for data access, the answer is, no.

larkydoo
User
Posts: 45
Joined: 30-Jun-2008
# Posted on: 30-Apr-2018 21:28:22   

Not ASP.NET Membership, ASP.NET IDentity, the thing that replaced Membership. I think my question is a duplicate of http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=22658&HighLight=1 from 2014. I take it the answer is still no.

Thanks.

Laurie

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 30-Apr-2018 22:14:00   

No we didn't bother implementing it as it kept changing (as in: completely changed) so it was a bit of a let down to get this up and running and then have to redo it all over again a short time later.

But if it's settled down a bit now we can have another look at it simple_smile

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 893
Joined: 14-Dec-2003
# Posted on: 01-May-2018 14:14:34   

As an example, here is a github project that shows using dapper instead of entity framework for this.

https://github.com/mark-j/dapper-identity

I think a similar approach replacing llblgen with dapper would be the ticket.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 01-May-2018 15:14:07   

Thanks for that simple_smile It might also be good to look at the code code of identity, as it's not wise to re-use a bug introduced by another reimplementation, it doesn't look like this implementation is using the core code and replaces some code with dapper but does a reimplementation.

Frans Bouma | Lead developer LLBLGen Pro
scotru
User
Posts: 104
Joined: 16-Feb-2006
# Posted on: 28-May-2019 10:08:12   

Is this something in the works? It looks like only a custom storage provider would need to be provided:

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-custom-storage-providers?view=aspnetcore-2.2

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-May-2019 15:25:08   

"only" smile

As history has proven, implementing support for any asp.net related framework as an ORM developer is a painful experience: not only do you have to do way more work than initially expected, it's also a process where you constantly have to play catch up and eventually have to deal with them abandoning the design for something 'better' and you have to decide whether you have to implement that new design too (so support 2 versions) or refactor the support for the new one and abandon the old one.

Hence my quotes around 'Only'. simple_smile I know these aren't your problems, and we shouldn't make them yours either, but they are part of our reality and what we've experienced with these frameworks coming out of Redmond on a regular basis.

I'm not looking forward to implementing support for this. It might look simple but sadly it's not. Their design works at times with interfaces (which we can deal with) and class requirements (which we can't, we can't derive from their base class). Perhaps we can find a way around that using a projection using a poco typed view.

However the next problem is tests. We don't have extensive asp.net core experience, so how to test this? The example contains just code of an example using the provider but I can't find any query in that chaos code. There are multiple folders, none of them are equal to the other, so apparently all combined they make 1 project? I can't find any code which performs database activity (so the code we have to replace). It's a lot but definitely not an example how to write your own storage provider simple_smile (afaics)

An example of that would have been "implement this interface on the provider. Implement these interfaces on the entity classes, that's it".

So in short: this documentation and the 'example' is, in one word, lacking. (Sorry Steve wink ). I don't see what to do as a data-access provider, and what to do with that result: do our users just reference a nuget package? Do they need to compile it from source? No idea.

There might be other examples out there, which are more descriptive, the thing remains that as this is security related, I really want to have tight tests.

Frans Bouma | Lead developer LLBLGen Pro
scotru
User
Posts: 104
Joined: 16-Feb-2006
# Posted on: 31-May-2019 01:24:46   

Sorry about the "only" smile Always easier to minimize code someone else has to write...
I took a deeper look at their example links from the documentation and you're right--it's really poor.

I don't know if this might be more helpful.

https://www.elemarjr.com/en/2017/05/writing-an-asp-net-core-identity-storage-provider-from-scratch-with-ravendb/

If I understand right from my cursory look, I think the thing is to implement the IXXXStore interfaces here (minimally IUserStore):

https://github.com/aspnet/Identity/tree/rel/1.1.2/src/Microsoft.AspNetCore.Identity

I can't speak for other developers but what I'd love is an implementation using LLBLGen store provider of the same functionality generated by the VS Wizard for EF with their MS's default identity schema. This could then be the basis for further customization for use use in our own apps.

I hear you about the rapid changes in the landscape from Redmond. Definitely it's a part of why some of us choose to use 3rd party products with more longevity (like a certain beloved ORM :-) I do like .NET Core though and I think it's here to stay.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 31-May-2019 09:11:36   

Thanks for the links! Alright, we'll look into it, perhaps we can do something for 5.6. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
scotru
User
Posts: 104
Joined: 16-Feb-2006
# Posted on: 14-Jun-2019 09:08:55   
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 14-Jun-2019 14:35:54   

Thanks! We'll check it out simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 25-Jul-2019 12:01:09   

Alright, it looks straightforward (implementing a couple of classes, creating projections to/from entities using DTOs, registering the assemblies with asp.net instead of the EF stuff). The problem we're facing atm is that asp.net identity has been merged into the main asp.net core repo and what to fork / pick up to change is a bit unclear till netcore 3.0 has been shipped so we'll wait till that ships as GA before we'll work on this. (The identity folder inside the asp.net core repo comes with tests, which should give a start to test the code)

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 06-Nov-2019 09:40:00   

There's now an implementation, open source, by Timothy Russel: https://github.com/timothyleerussell/Snoffleware.LLBLGen.Identity

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 893
Joined: 14-Dec-2003
# Posted on: 06-Nov-2019 13:49:27   

Been hoping for this, I'll have a look. Thanks!