Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

How to set up a CustomUserRepository? #701

Open
Vincent026 opened this issue Mar 1, 2017 · 8 comments
Open

How to set up a CustomUserRepository? #701

Vincent026 opened this issue Mar 1, 2017 · 8 comments

Comments

@Vincent026
Copy link

Vincent026 commented Mar 1, 2017

Hello,

we want to make a CustomUserRepository based on our own database repository (no EF, Mongo or Raven). I derive this repo from QueryableUserAccountRepository, register the user & group repo's (as singletons) plus their services with the IdentityManagerServiceFactory and implement the repo-methods. I have some trouble to make it work. I manage to get the list of users on the screen but when I try to edit a single user I get Error: An error has occurred.

Some useful hints would be great.

thanks,
Vincent

@brockallen
Copy link
Owner

@Vincent026
Copy link
Author

Thanks for the quick response Brock! I will have a close look at this article again.

@Vincent026
Copy link
Author

Vincent026 commented Mar 2, 2017

Our current implementation, based on your examples, uses some InMemory clients, users and scopes, registered in the IdentityServerServiceFactory, which is mapped to the path "/identity". I see that there is also a mapped path named "/core". Which mapping do I need to the configure the IdentityServerServiceFactory, in order to register the custom user service?

kind regards

@brockallen
Copy link
Owner

Whichever you want. All of those are just samples.

@Vincent026
Copy link
Author

Thanks! My first thought was that these where compulsory predefined end points. I am getting closer to what I want.

@Vincent026
Copy link
Author

Vincent026 commented Mar 8, 2017

I am making progress with implementing CustomUserAccountService and CustomUserRepository. It seems that a hashed password is expected to be stored. Our table has a readable password field and that is ok with us. I rather don't modify the schema of the user table, What I am trying to do now is intercepting authentication by overriding the Authenticate method(s) in the CustomUserAccountService. Is this a good strategy for overriding authentication (to validate the password with the readable field instead of using the hashedpassword)?

@brockallen
Copy link
Owner

If you have an existing DB for users, then I don't see why you want to use MR. Just implement the IUserService in IdentityServer.

@Vincent026
Copy link
Author

Vincent026 commented Mar 8, 2017

You are right that we already have a way of filling our DB and there is no need for us to have MR to do the CRUD actions. However, this may change in the future. Besides that, we have several user sources and I can use MR to show the combined set. I don't implement the Create, Update and Delete methods in the repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants