You just need to add the https://<CUSTOM_DOMAIN>/login/callback
to your list of allowed urls IN GOOGLE application. Enter the application and add. If you do this - you will not have any error.
I ask community to add to google tutorial this steps, because I also faced on it.