3

I'm currently creating a web and mobile application using ionic2+ and .net core backend. After implementing a quick start from identityserver4 docs including identity + Entity framework i realized that i don't have a way to create users from the mobile app.

My solution is composed of the following projects:

  • Project.Api
  • Project.Web
  • Project.IdentityServer

The 3rd one implements identity and from the web I can redirect to identityServer for login and registration. In the api I have configured the authority to the identityserver project and if I get a token from the identityserver and append it to the authorization header of my http request I'm perfectly able to access protected endpoints. But I have to create the users directly in the database.

There is a way to register the users directly in the identityServer project?

aaronR
  • 1,557
  • 2
  • 16
  • 26

2 Answers2

1

I would advice you to implement your own user management, there are some options you can easily use with IdentityServer4.

For example you can create your own user store and use it in IdentityServer4.

Here is a quick Demo on how to do it. https://github.com/IdentityServer/IdentityServer4.Quickstart.UI

Basically all you need to do is:

  • Implement authentication directly on the account controller.

  • Implement IProfileService to return claims for tokens

Also in case you are already familiar with ASP.NET Identity, it is supported by IdentityServer, check this out:

http://docs.identityserver.io/en/latest/reference/aspnet_identity.html

IdentityServer4 also supports windows authentication (in case you want to use your domain users) and it is quite a simple thing to implement, check this out:

http://docs.identityserver.io/en/latest/topics/windows.html

Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114
0

Sounds like, your mobile app wants to imitate the IdentityServer functionality, in that case I would suggest have an API project (make sure to protect this resource backed up by IdentityServer). Then you make requests to the api end points to create/modify users.

Ideal approach is to redirect to Idm server pages, where you already centralized the logic and workflows for user creation.

Jay
  • 1,869
  • 3
  • 25
  • 44
  • Initially my plans where to leverage all the user management and authorization/authentication to a project using netcore.identity and identityServer4 in a separate database which is the right approach acording to the docs. But then my mobile users would have to previously register at the website. I think i'm going to do now i to use the same database for the entire solution, implement an additional project for netcore.identity, a couple of user management services and reference from api and web projects, the identityServer project is going to act only as authorization/authentication. – Jonathan Corredor Nov 29 '17 at 14:00