The Google authentication is using Google libraries and is Google-specific. If you want to use another OAuth 2.0 server the way to go would be to the the custom authentication coupled with a OAuth 2.0 client library (like PHP League's OAuth 2.0 Client).