MutonUfoAI / pgina

pGina fork: Open Source Windows Authentication
http://mutonufoai.github.io/pgina
BSD 3-Clause "New" or "Revised" License
156 stars 39 forks source link

User session is disconnected immediately after login through RDP #159

Open maheshmadhyastha7 opened 4 years ago

maheshmadhyastha7 commented 4 years ago

Hi, I have pGina fork which is configured with custom plugin for authentication. Everytime I try login through RDP, it says processing logon for the user. But after some time it disconnects immediately. Need help urgently. I am using pgina fork 3.9.9.12 on Windows Server 2019 pGina.Service.ServiceHost_log.txt

maheshmadhyastha7 commented 4 years ago

Can anyone help pls?

MutonUfoAI commented 4 years ago

As I've told you, you don't have endless time available to finish your login process.

The pGina.Plugin.WPMC.WpmcPlugin is fast processing all those groups but LocalMachine isn't 2020-02-26 16:38:23,880 [2484|10|DEBUG] LocalAccount[mahesh]: SyncToLocalUser() 2020-02-26 16:39:07,505 [2484|10|DEBUG] LocalAccount[mahesh]: End SyncToLocalUser()

https://github.com/MutonUfoAI/pgina/blob/1922de0fe27492c09d2f188c2c7e54a4b364bbad/Plugins/LocalMachine/LocalAccount.cs#L411

maheshmadhyastha7 commented 4 years ago

Can you pls help in finding solution for this ?

MutonUfoAI commented 4 years ago

The solution would be, not letting the localmachine plugin doing the sync. Do it on your own.

Run the localmachine plugin before your own and your plugin is adding the user to the appropriate groups

maheshmadhyastha7 commented 4 years ago

And how to configure that in plugin?

maheshmadhyastha7 commented 4 years ago

I think its the local machine plugin which has to do the sync. My plugin is just validating the users against the user groups in server.

maheshmadhyastha7 commented 4 years ago

???

MutonUfoAI commented 4 years ago

local machine is to slow to do the work so do it on your own https://docs.microsoft.com/en-us/windows/win32/api/lmaccess/nf-lmaccess-netlocalgroupsetmembers https://www.pinvoke.net/default.aspx/netapi32.netlocalgroupgetmembers