#1 2018-06-18 11:35:32

JerryC_ph
Member
Registered: 2013-03-11
Posts: 16

Windows Authentication for MVC/MVVM

Hi everybody,

Is there a way to use windows authentication on MVC/MVVM applications?

Offline

#2 2018-06-19 06:23:47

Chaa
Member
Registered: 2011-03-26
Posts: 248

Re: Windows Authentication for MVC/MVVM

There is two optons:

1. If you use TSQLAuthUser/TSQLAuthGroup for user management, then you can call TSQLRestServer.Auth, check it results and create web session on success.

2. If you use other user management (like in sample "30 - MVC Server"), then you can copy some code from TSQLRestServerAuthenticationSSPI.Auth to your web app.

Sample code:

Copy MVCViewModel.pas from mORMotMVC-20180619.zip to your "30 - MVC Server" folder and rebuild server.
Add row to TSQLAuthor table with the LoginName in form 'DomainName\UserName'.
And navigate to http://localhost:8092/blog/SingleSignOn

P.S.
We discuss Linux support for Windows authentication, and we are interested in your opinion:
https://synopse.info/forum/viewtopic.php?id=931&p=2

Offline

Board footer

Powered by FluxBB