https://discord.umbraco.com logo
#social
Title
# social
m

marcusjmsweden

03/10/2022, 10:32 PM
First reason would be to store the users in a different place but also with some custom settings. Member part is not used at all here
Is there a 24 days article or something about customizing the 9 version of identity 🙂
p

p-m-j

03/10/2022, 10:34 PM
Not sure, what is it that you want to customize?
m

marcusjmsweden

03/10/2022, 10:34 PM
But my initial idea was to just slap on efcore and identity core
p

p-m-j

03/10/2022, 10:34 PM
but why :p
m

marcusjmsweden

03/10/2022, 10:35 PM
To use a common database for users that is shared with other apps
but if you say it is already included, shouldn't the UI features also be possible without adding anything else?
p

p-m-j

03/10/2022, 10:36 PM
we have custom UI in the backoffice for users and members
p

p-m-j

03/10/2022, 10:36 PM
to replace backoffice users setup take a look at all the things to replace here
however
my advice, stick identity server infront of your old datasource
and use it as an external login service
m

marcusjmsweden

03/10/2022, 10:36 PM
Same for frontend I suppose?
this is just for fronend users
backend is not important for thsi
this
m

marcusjmsweden

03/10/2022, 10:38 PM
ok thanx I will look into this
p

p-m-j

03/10/2022, 10:38 PM
members i'd be more tempted to do your own thing
no reason you can't just ignore what's there and register more identity instances
what went wrong when you tried to add your own identity setup?
again external login is an option for members
m

marcusjmsweden

03/10/2022, 10:39 PM
actually that was my initial plan
since members is not part of this, it is all external
i mean members will not be used at all in this particular solution
just verifying stuff with external db
p

p-m-j

03/10/2022, 10:40 PM
just to be clear on what you mean by members
are you trying to get folks into the backoffice?
m

marcusjmsweden

03/10/2022, 10:40 PM
Umbraco Members
nope
frontend only
p

p-m-j

03/10/2022, 10:40 PM
cool, so you could setup members with an external login provider
or just add your own UserManager etc
m

marcusjmsweden

03/10/2022, 10:40 PM
i could have gone the openid route but I just need something simple
that last part
my own usermanager
p

p-m-j

03/10/2022, 10:41 PM
that should be fine
what went wrong
m

marcusjmsweden

03/10/2022, 10:42 PM
well not yet but i was trying to add the "UI" features and had problems with version conflicts
but since it already uses identity that explains it
i thought it still used the old stuff
just because it is a fast track to do it, I know I can do it manually 🙂
but your examples is a good starting point so I hope I can manage
p

p-m-j

03/10/2022, 10:43 PM
we have references to Identity 6.0.0 5.0.11, there are two usermanagers (and associated dependencies) registered one for members one for backoffice users. There should be no reason you can't add a third 🙂
m

marcusjmsweden

03/10/2022, 10:44 PM
you mean net6 version?
could that be why I had problems. I used the net5
but from what you said. I can just add my own stores and managers here?
.AddUserStore<IUserStore, MemberUserStore>(factory => new MemberUserStore( factory.GetRequiredService(), factory.GetRequiredService(), factory.GetRequiredService(), factory.GetRequiredService(), factory.GetRequiredService(), factory.GetRequiredService(), factory.GetRequiredService() )) .AddRoleStore() .AddRoleManager()
sorry
m

marcusjmsweden

03/10/2022, 10:46 PM
Copy code
.AddUserStore<IUserStore<MemberIdentityUser>, MemberUserStore>(factory => new MemberUserStore(
                    factory.GetRequiredService<IMemberService>(),
                    factory.GetRequiredService<IUmbracoMapper>(),
                    factory.GetRequiredService<IScopeProvider>(),
                    factory.GetRequiredService<IdentityErrorDescriber>(),
                    factory.GetRequiredService<IPublishedSnapshotAccessor>(),
                    factory.GetRequiredService<IExternalLoginWithKeyService>(),
                    factory.GetRequiredService<ITwoFactorLoginService>()
                ))
                .AddRoleStore<MemberRoleStore>()
                .AddRoleManager<IMemberRoleManager, MemberRoleManager>()
p

p-m-j

03/10/2022, 10:47 PM
it's probably easier to completely ignore all the umbraco members stuff and just add a new setup for a new user type
m

marcusjmsweden

03/10/2022, 10:47 PM
Ah ok
that was my initial plan actually 🙂
p

p-m-j

03/10/2022, 10:47 PM
UmbracoMembers is all pretty coupled to the CMS, some data stored as CMS content etc
so you probably want to avoid our interfaces and classes
m

marcusjmsweden

03/10/2022, 10:48 PM
yes
that is how I did it before
unfortunatelly that was in v7 so my memory is a bit off here
anyway thanx for the help
p

p-m-j

03/10/2022, 11:05 PM
sorry i had wrong branch checked out, we depend on identity 5.0.11 in v9
m

marcusjmsweden

03/11/2022, 12:02 AM
Then it makes sense 🙂