• Resolved StanfordAlan

    (@stanfordgriffith)


    Hi,

    I followed your directions exactly (I think) twice to set up this with Gmail. I get an error before I can even try to send a test email.

    After I entered and saved my Client ID and Client Secret keys, I hit save. Then, I clicked the Allow plugin to send emails using your Google account button. When I do that, I get this error:

    400. That’s an error.
    
    Error: invalid_request
    
    Missing required parameter: client_id
    
    Learn more
    Request Details
    
        response_type=code
        redirect_uri=https://thecenterproject.org/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
        client_id=
        scope=https://www.googleapis.com/auth/gmail.send
        access_type=offline
        approval_prompt=force
        include_granted_scopes=true
    
    That’s all we know.

    I used the correct information off both sites, and the keys don’t have spaces. I’m at quite the loss. As I said, I’ve tried this twice now.

    If I do try to send a test email, the returned error message is that I’m not logged in, which isn’t a surprise.

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 5.6.33
    WP Mail SMTP: 1.2.2
    
    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No
    
    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    
    Debug:
    Error while sending via Gmail mailer: Error calling POST https://www.googleapis.com/gmail/v1/users/me/messages/send: (401) Login Required

    Any ideas?

    Thanks.

Viewing 11 replies - 16 through 26 (of 26 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    @nuvopoint
    Same issue in which way? Please describe in details (where you host, what’s the server OS etc).

    @slaffik
    The link “Allow plugin to send emails using your Google account” does not contain any client_id and this gives the following error:

    400. That’s an error.
    Error: invalid_request
    Missing required parameter: client_id

    If I manually edit the link in the html to include the client_id I get the following error:

    401. That’s an error.
    Error: invalid_client
    The OAuth client was not found.

    We have our own hosting setup with nginx server, running Ubuntu on AWS, with cloudflare in front.

    Plugin Author Slava Abakumov

    (@slaffik)

    @nuvopoint

    Regarding the first one (initial, no client_id in button URL):
    In order to troubleshoot further, I’ll need to collect more details. When you get a chance, would you please go to https://wpforms.com/contact/ and click the ‘Complete a Form’ button on the right side? This will allow you to submit a ticket without a WPForms account. Please mention there in your message my name (Slava) with a link to a thread and/or short description of a problem, so I will be notified.

    Regarding the second error: Make sure that you have logged in here: https://console.developers.google.com/ – and got the valid Client ID (without spaces, anywhere): https://take.ms/3vJIc

    @slaffik
    I found the cause of the issue.
    When you have activated “WooCommerce Google Analytics Pro” then your plugin wont work. This might be a conflict with both plugins trying to use Google API’s and SDK. Any ideas on how to fix this?

    Plugin Author Slava Abakumov

    (@slaffik)

    Great that you found it!
    Seems, it’s this one: https://github.com/awesomemotive/wp-mail-smtp/issues/82
    I will add details there. I plan to fix with the next plugin release later this month.
    Right now there is no easy fix, unfortunately (without plugins deactivations).

    Plugin Author Slava Abakumov

    (@slaffik)

    @nuvopoint
    Can you confirm, when you deactivate that plugin, the client_id value appears normally inside the WP Mail SMTP “Allow..” button link? Or was that Woo plugin responsible for the 2nd issue?

    @slaffik
    I can confirm that your plugin will work if “WooCommerce Google Analytics Pro” is disabled. Both issues are related to having the SDK included in both plugins which most likely have the same namespace and therefore conflict.

    Plugin Author Slava Abakumov

    (@slaffik)

    Great, thank you for the confirmation! That helps a lot.

    Plugin Author Slava Abakumov

    (@slaffik)

    @nuvopoint
    @rs2ks

    Some other user confirmed that having a plugin, that is bundled with Google API, might be a reason for a conflict and this Missing required parameter: client_id issue.

    WP Mail SMTP 1.3.0 will have the fix for that (as we can’t fix other plugins) – by renaming all Google API classes.

    Thanks its helped me to resolve problem ??

    Hello,

    I also face the same problem with WPMail SMTP and Google Analytics Pro plugin.

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 7.2.6
    WP Mail SMTP: 1.2.5
    
    Params:
    Mailer: gmail
    Constants: No
    
    Debug:
    There was a problem while retrieving Mailer for gmail: Could not json decode the token

    When deactivating Google Analytics PRo plugin everything works as expected. No errors and mails are sent normally.

    Can you please tell me how did you managed to solve the issue? Do we need to rename API classes names by hand? Should we wait for 1.3.0 version to be released?
    Do you approximatelly know when 1.3.0 version will be out?

    Regards, Othon

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Error when authorizing plugin from settings page’ is closed to new replies.