Login to Linux using PAM

I have a client application that login into a Linux backend using PAM via

a daemon written in c. Client connects to daemon using sockets, passing user/pwd to the daemon.

Daemon then logs in using PAM, forks/execs and the new process executes as the user,

and still keeps the socket - inherited from the daemon.

Now, I’d like to retire that daemon with an ada-daemon.

Does anyone have done PAM client stuff from Ada, and have some code snippets?