How to customize the authentication progress or login function

We are planning to setup Gitlab Enterprise Edition.
But we need your help to provide a solution about how to customize the user login function to implement the single sign-on through our company’s authentication server.
i.e how to rewrite the login function?

notice: our company’s authentication server is not Oauth server.
thanks in advance!

Best Regards,