Custom auth

I am trying to set a offline-server with lots of useful tools, gitlab being one of them
I want all the servers to have obligatory common auth.

For gitlab it will mean that i want login page to immediately redirect user to my common OAuth2 provider.
I think there is no easy way to do so, thus I wonder where are the sources of login part of UI to patch them and rebuild gitlab.