Angular-based login page for IdentityServer

柔情痞子 提交于 2020-12-29 06:48:31

问题


I'm developing a frontend app with angular and a backend with Asp.Net Core, which contains and IdentityServer4 for authentication (based on this github project).

At the moment I'm logging in the IdentityServer's login page, but I want to use a custom login page developed in angular instead of using the IdentityServer's login page, instead using the login service of the AccountController.

I can call this service via http request from Angular app, but I cannot obtain the access jwt token generated by the _signInManager.PasswordSignInAsync function. Is this possible? I've been searching, but I've not found a clear solution.


回答1:


You have to ask yourself something. Do you really need IdentityServer? Do you require a separate application for login?

A valid answer would be if you need it for SSO. Because you can perfectly change the whole quick start template from ASP.Net MVC to a Angular frontend and a webapi.

But I have a feeling you want to integrate your login page with your application front end. This doesn't make much sense from and OAuth view point. Because idsrv is built to be a separate application.

For example the Google login page is on a seperate domain so other applications (Like Stackoverflow) use that one to check if you are authenicated. If you would move this functionality again to the application (in this case Stackoverflow) you wouldn't have gained anything.

You can ofcourse use the PasswordCredential flow. But if you only have one application than you are probably using identity server only for the JWT generation. And you can do this more simpeler.

So can you give a little bit more information about your architecture?

(This should be a question instead of an answer but it's to long...)



来源:https://stackoverflow.com/questions/51539091/angular-based-login-page-for-identityserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!