Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular-based login page for IdentityServer

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.

like image 693
Juan Avatar asked Jul 26 '18 12:07

Juan


1 Answers

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...)

like image 74
ErazerBrecht Avatar answered Oct 24 '22 05:10

ErazerBrecht