Search code examples
asp.net-identityidentityserver4

Generate ReturnUrl with IdentityServer4


I currently have the following architecture

  • Marketing Site (Landing Page)
  • WebAPI
  • SPA
  • IdentityServer

I have included my user registration page in the IdentityServer project and have a link to this page on my Marketing Site.

My question is...is there a way I can generate the returnurl to the Spa from within IdentityServer. Are there any helpers for this?


Solution

  • Nothing out of the box for this, but it would work just fine if instead of having a link to the registration page, the link would be the connect/authorize request to the login page (which in turn would have a link to user registration page).

    This sort of user login/registration flow is implemented almost everywhere now, so likely can also be called somewhat best practice. It would implicitly take care of your problem because the redirect uri would be included in the regular oidc request.