Example of linux pam authenticaion

I’m attempting to get linux login to use keycloak.
Started trying the pam_oauth2 module but can’t quite get it to work.

Is there an example of this somewhere?