Autorun user after registration in Identityserver4

our registration process is an Angular2 app that calls .NET Core APIs. After registering, we would like to automatically login the user to Identityserver4, instead of just redirecting the user to the login page where they need to enter their username / password again.

Has anyone else been able to get this to work? Most of the other solutions seem to be implemented with Identityserver3.

+3


source to share


1 answer


All you have to do is register the user in the registration action with your controller responsible for it. In other words, you process your registration controller method according to how you handle your login controller method using this method:

await HttpContext.Authentication.SignInAsync()

      



This method essentially prepares HttpContext

your browser to release with a cookie when you return the appropriate one from it IActionResult

. I'm sure you've seen this one or something like that. Just do the same in the registration method.

+1


source







All Articles