IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Is it possible host Quickstart UI in a separate client project outside IdentityServer4 project?

Open rajivverma opened this issue 5 years ago • 7 comments

I am following co-hosting example from quickstart example. Let's say this application is hosted at https://localhost:5001.

I want to use Quickstart UI to implement login page and related functionality. But I want host these MVC pages in a separate ASP.NET MVC client project, which uses this identity server for authentication. Let's say this application is hosted at https://localhost:4001.

Based on this reference, it seems I can specify login URL as https://localhost:4001/account/login. However, how am I supposed to implement/change the actual login logic in AccountController.cs and ExternalController.cs ? I don't have access to the database or entity framework database contexts ConfigurationDbContext and PersistedGrantDbContext in this project.

rajivverma avatar Mar 04 '21 18:03 rajivverma

All of our quickstarts host the client, the API, and IdentityServer in separate hosts:

https://github.com/IdentityServer/IdentityServer4/tree/main/samples/Quickstarts/3_AspNetCoreAndApis/src

brockallen avatar Mar 04 '21 18:03 brockallen

@brockallen Thanks for your quick response. I believe I was not clear in asking the question. In the example you shared, Quickstart MVC pages are still inside the IdentityServer project here. I want to host these MVC pages inside the MVC client project here.

rajivverma avatar Mar 04 '21 18:03 rajivverma

Oh, you meant the quickstart UI for like login, logout, etc. that we bundle in the host w/ IdentityServer? Doing that is an anti-pattern, as you'd lose SSO.

brockallen avatar Mar 04 '21 21:03 brockallen

Idea was to separate the UI interaction code in a separate project and keep the SSO with ID server project. I believed it would have been possible if somehow UserManager and SignInManager could use REST APIs instead of EF context to access configuration and persistent grant data directly?

rajivverma avatar Mar 05 '21 09:03 rajivverma

If you can get the SPA to issue the cookie in IS, then sure, that sounds like it would work.

brockallen avatar Mar 05 '21 14:03 brockallen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Mar 16 '21 04:03 stale[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 04 '21 23:04 github-actions[bot]