Last post Sep 19, 2019 12:39 AM by mywatermelon
Sep 18, 2019 03:48 AM|mywatermelon|LINK
I have made a login and registration by asp.net core identity via the tutorial of this https://www.youtube.com/watch?v=egITMrwMOPU&list=PL6n9fhu94yhVkdrusLaQsfERmL_Jh4XmU&index=65 yet.
And now my WPF application needs to login and register with the server-side.
I don't know how to communicate with the server-side and the WPF application.
Is there any interface or middleware can solve this?
In addition, the version of asp.net core is 3.0RC and the version of WPF is .net framework 4.8.
Sep 18, 2019 04:00 PM|bruce (sqlwork.com)|LINK
the sample you used is cookie authentication and individual identity, with web pages for login and register. you need webapi calls to do the register and login. this calls can use the similar code to the pages.
while its possible for a WPF application to use cookie authentication, its usually done via screen scraping, or hosting a browser control.
its more common to use bearer tokens (JWT). here is a simple example:
this tutorial uses a simple list for the users database. you would of course use the identity you built above.
note: asp.net core 3.0 has better authorization support. the webapi template will support an oauth server, but does not include Individual (like your tutorial). the react / angular templates support Individual with JWT, and you could use one of these as
a basis. but you will need to read the js code to determine the webapi calls.
here a simple JWT tutorial for core 3.0 webapi with JWT and Indvidual authentication.
Sep 19, 2019 12:39 AM|mywatermelon|LINK
Thanks a lot. Let me try first.