Announcement

Collapse
No announcement yet.

Enabling google login for vbulletin 5.4.2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enabling google login for vbulletin 5.4.2

    I follow this general procedure:

    1 Login with your existing Google account or create a new account if necessary.
    2 Navigate to the Google Developers Console.
    3 Click on the CREATE PROJECT link on top of the page, enter the following value and click on the Create button.
    Project Name: ________ (Whatever)
    4 Return to the list of your projects and wait for the project to be created (Try to refresh the page if you don't see the project yet).
    5 Click on the name of your new project, then on Google APIs in the upper navigation bar and finally on Library on the left side.
    6. First click on the Social APIs \ Google+ API link and then on the Enable link on top.
    If you have a Disable link instead then the API is already enabled and you do not need to make any changes.
    6. Now click on the Credentials link in the left navigation bar and then on OAuth consent screen and enter these values:
    Product name shown to users: ________
    Privacy policy URL: ________ (from your forum)
    8 Now click on the Credentials link in the left navigation bar, then click on the Create credentials button and select OAuth client ID.
    9 Fill out the form with the following values and then click on the Create button.
    Application type: Web application
    Name: ________
    Authorized JavaScript origins: ___________
    Authorized redirect URIs: _________
    10 Copy&paste your OAuth keys into vbulletin.

    What exactly would the two authorized JS origins and redirect URLs be? if say your vbulletin is at https://www.whatever.com/forums

    I am using https://www.whatever.com as the JS URL, and

    https://www.whatever.com/forums as the redirect URL

  • #2
    http://www.whatever.com

    https://www.vbulletin.com/forum/foru...07#post4392407

    However vBulletin Cloud hasn't been upgraded to vBulletin 5.4.2 yet.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      If the JavaScript is https://www.whatever.com
      then is the redirect
      https://www.whatever.com/forums
      ?
      (Assuming that /forums is exactly where the forums are)

      Comment


      • #4
        I am asking for clarification from the developer who created this extension.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          Also please ask - if you click to login via Google, it asks you to choose a Google account, and then if decide not to do it (decide not to proceed) by collapsing the window that asks you to choose a Google account, you get this error:

          Click image for larger version  Name:	GoogleLogin_error_vbulletin.jpeg Views:	1 Size:	46.2 KB ID:	4392415
          I don't think an error should pop up just because you decide against logging in via the social account.

          Comment


          • #6
            Originally posted by MDawg View Post
            If the JavaScript is https://www.whatever.com
            then is the redirect
            https://www.whatever.com/forums
            ?
            (Assuming that /forums is exactly where the forums are)
            The "Authorized redirect URIs" option is not used by the googlelogin plugin (getting the auth code from google is handled by their javascript library). You can leave that value empty.

            I don't think an error should pop up just because you decide against logging in via the social account.
            The error popup is meant to provide tangible feedback to the user that the plugin tried to initiate the auth/link but failed unexpectedly (note that the google auth popup is handled by their JS library, not our plugin).
            At the moment, it's kind of a catch-all whether it failed because of a popup-blocker, or because the user entered in the wrong password when trying to log in to their google account, or in this case because they intentionally closed the window.
            We can probably change it so the last case (intentional close) shows a different message confirming that they are NOT linked/authorized instead of the generic error.
            If you have any ideas on improving the error message (or improvements to the overall flow), could you create an improvement request ticket via the tracker?

            Comment


            • Jin-Soo Jo
              Jin-Soo Jo commented
              Editing a comment
              As a note it seems like when the popup is intentionally closed, google passes "popup_closed_by_user" into the error handler so we can check for that and suppress or change the messaging.

            • MDawg
              MDawg commented
              Editing a comment
              Done.
              https://tracker.vbulletin.com/vbulle...sues/VBV-18552

          • #7
            Is this working lately? VB5 login via gmail? I am not sure.

            Comment


            • #8
              Nothing has changed with this functionality as far as I am aware. What makes you think it doesn't work? What happens when you try to log in with a Google Account?
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment


              • #9
                I have tested this across three different vb5 forums three 5.6.1 and one 5.5.4 - basically - nothing happens it allows you to login to your gmail but then it does not login to the vbulletin forum.

                When I went into the google developer's accounts there were notices that I had to resubmit the apps because I had changed the logos - although I had not! - so I resubmitted them for verification, but then google wrote back to me and said that re-verification was not necessary unless I cared about the logo, in that the logo wasn't even being used anyway. So I don't think the issue is at the google end.

                Comment


                • #10
                  Google login still seems to work when I tested it locally this morning. We need a bit more information.

                  If you run this query, does it return a record?
                  Code:
                  SELECT *
                  FROM `{TABLE_PREFIX}loginlibrary` WHERE `productid` = 'googlelogin';
                  You do not have to post the values here, but it should return something like
                  loginlibraryid productid class
                  {INTEGER REDACTED} googlelogin GoogleLogin:ExternalLogin
                  If, for some reason, the record is missing, you should be able to resolve it by re-importing the googlelogin product XML (but please do let us know here if that is missing).

                  Are the APP ID & secret still correct? You can view those via
                  https://console.cloud.google.com/apis/credentials?project=<PROJECTID> > O Auth 2.0 Client IDs > <client for your forum> > Edit
                  and it should show "Client ID" and "Client Secret" on the right side (do NOT post those here).
                  These values should match the ones saved in the settings under "Third Party Login Options" > "Google OAuth Client ID" & "Google OAuth Client Secret".

                  When you try to connect a vBulletin user account to a google login account (via .../settings/account > "Third-party Login Providers" > "Connect to Google" button), what happens? Ideally there will be a pop-up to authorize the app, and once you accept, the button on the vBulletin account settings will update to "Disconnect from Google".
                  Once connected, if you refresh the settings page does it maintain that connection or does it seem to have lost the account connection?
                  Could you also verify that when viewing the user in adminCP (e.g. adminCP > Search for Users), under "External Connections" at the bottom right of the adminCP user profile, a row stating "Google Yes" is there for that user?

                  If none of the above showed any issues, you may need to re-verify the various URLs the google app requires. E.g. under the oauth client id, the "Authorized JavaScript origins", "Authorized domains", "Applcation Privacy Policy link" under "OAuth consent screen" in the google API console, etc.

                  If everything above checks out and login is still failing, we may need to add some test code to figure out what status or message the google oauth is returning.

                  Comment


                  • #11
                    Yes when I run the query I get
                    MySQL said:
                    #1146 - Table 'XXXXX_XXXXX.{TABLE_PREFIX}loginlibrary' doesn't exist

                    I re-imported the product_googlelogin.xml
                    but when I ran the query again got the same error.

                    Comment


                    • #12
                      You have to replace {TABLE_PREFIX} with whatever value you have defined for the table prefix in your /core/includes/config.php file.
                      Translations provided by Google.

                      Wayne Luke
                      The Rabid Badger - a vBulletin Cloud demonstration site.
                      vBulletin 5 API - Full / Mobile
                      Vote for your favorite feature requests and the bugs you want to see fixed.

                      Comment


                      • #13
                        That would be nothing?

                        $config['Database']['tableprefix'] = '';

                        so how exactly would I enter the query?

                        Comment


                        • #14
                          You would remove {TABLE_PREFIX} from the query if your table prefix is empty.
                          Translations provided by Google.

                          Wayne Luke
                          The Rabid Badger - a vBulletin Cloud demonstration site.
                          vBulletin 5 API - Full / Mobile
                          Vote for your favorite feature requests and the bugs you want to see fixed.

                          Comment


                          • #15
                            Then it would appear that I am getting the expected value.

                            Comment

                            Related Topics

                            Collapse

                            Working...
                            X