Auth0 Home Blog Docs

Custom Sign Up with Google button does not work

google
tier1
custom
sign-up

#1

I have a button called Google Login on my hosted login page, and I wanted users to be able to login via that page

  document.getElementById('google-login').addEventListener('click', function() {
    console.log(config.clientID);
    webAuth.authorize({connection:"google-oauth2"});
  });

However, this always is giving me the following result

you need to specify the client argument in the querystring

NOTE: Even if I add the clientID to the authorize request, it doesn’t do anything


#2

I could not reproduce the situation in question by performing the following steps:

  1. Enable the customization of the hosted login page.
  2. From the default templates list pick the custom login form one (which already uses Auth0.js and as a sign-in with Google button that basically does what your code does).
  3. Navigate to the /authorize endpoint with the necessary parameters for a client application that has the Google connection enabled.
  4. Press the login with Google button.

The above correctly redirected me to Google. Given that one of the default templates already has the Google button I would recommend you to use the default template unchanged to verify if it’s something wrong with you customization. If even the default template does not work then the issue may be due to the way you are initiating the navigation to the /authorize endpoint. In this case you should update your question with enough information to troubleshoot this situation.


#3