Home Forums Account Management [Account Management] Api Key don't work

Tagged: , , , ,

This topic contains 30 replies, has 2 voices, and was last updated by  Hudson Atwell 4 months ago.

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #130698

    nixadmin
    Participant

    Hello

    We have problem with activated our pro version plug-in

    When we try to enter tho api key in wordpress-dashboard > InboundPro > Settings > Inbound API Key:
    we have error:

    “The connection is being blocked . Please contact Inbound Now support for further assistance!”

    Should be open some spicific port our it’s plug-in problem? Api key is correct and copied from account

    #130710

    Hudson Atwell
    Keymaster

    Hi,

    Welcome to the support forum. This message fires when there is a 403 forbidden error which is hard to diagnose from our end and usually occurs because of a custom security setting installed on the host. Request for assistance from your hosting provider should shed more information on why it’s not able to connect to our external APIs.

    Will you request an inspection from your hosting team’s support. It’s highly unlikely our servers are blocking the connection. Everytime a user has this issue it’s been a host security issue related to the user’s host.

    Kind regards and looking forward to your reply,
    Hudson Atwell

    #130722

    nixadmin
    Participant

    Hello

    We support customer server

    We do not have the prerequisites to assume that the outgoing connection is closed.

    Also there are no errors in the web server logs and php handler logs

    Specify which type of connection is used to activate the plug-in and which port, as well as other characteristics of the connection will be useful

    Regards

    #130723

    Hudson Atwell
    Keymaster

    Hi,

    Here’s how we are connecting to the API from the client’s installation:
    https://github.com/inboundnow/inbound-pro/blob/master/classes/admin/class.ajax.listeners.php#L83-L88

    You can see we are using the wp_remote_post method.

    Here you can see where we are defining the remote POST API URL:

    https://github.com/inboundnow/inbound-pro/blob/master/classes/admin/class.inbound-api-wrapper.php#L43

    Which end up being:
    https://www.inboundnow.com/pro-api/key/check/

    #130724

    nixadmin
    Participant

    curl -Iv https://www.inboundnow.com/pro-api/key/check/
    * Trying 35.185.62.238…
    * Connected to http://www.inboundnow.com (35.185.62.238) port 443 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    * CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
    * SSL connection using TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
    * Server certificate:
    * subject: CN=www.inboundnow.com
    * start date: Jun 28 00:22:00 2017 GMT
    * expire date: Sep 26 00:22:00 2017 GMT
    * common name: http://www.inboundnow.com
    * issuer: CN=Let’s Encrypt Authority X3,O=Let’s Encrypt,C=US
    > HEAD /pro-api/key/check/ HTTP/1.1
    > User-Agent: curl/7.40.0
    > Host: http://www.inboundnow.com
    > Accept: */*
    >
    < HTTP/1.1 401 Unauthorized
    HTTP/1.1 401 Unauthorized
    < Server: nginx
    Server: nginx
    < Date: Thu, 27 Jul 2017 16:32:10 GMT
    Date: Thu, 27 Jul 2017 16:32:10 GMT
    < Content-Type: application/json
    Content-Type: application/json
    < Connection: keep-alive
    Connection: keep-alive
    < Keep-Alive: timeout=20
    Keep-Alive: timeout=20
    < Set-Cookie: edd_wp_session=9ca89b769c90c5476dd9447ce6992e76%7C%7C1501216329%7C%7C1501214529; expires=Fri, 28-Jul-2017 04:32:09 GMT; Max-Age=43200; path=/
    Set-Cookie: edd_wp_session=9ca89b769c90c5476dd9447ce6992e76%7C%7C1501216329%7C%7C1501214529; expires=Fri, 28-Jul-2017 04:32:09 GMT; Max-Age=43200; path=/

    <
    * Connection #0 to host http://www.inboundnow.com left intact

    From the server your site opens, is there any more ideas?

    #130725

    nixadmin
    Participant

    same error: The connection is being blocked . Please contact Inbound Now support for further assistance!

    also can you check my key?
    What part of the key do you need to write so you can check its status?

    #130726

    Hudson Atwell
    Keymaster

    I suspect that the parent server doesn’t like the POST request.

    https://github.com/inboundnow/inbound-pro/blob/master/classes/admin/class.ajax.listeners.php#L83-L88

    You can see we are sending ‘api-key’ and ‘site’ as POST params inside the wp_remote_post connect. If you add any values to those you should get a API response
    , but when the client does it using wp_remote_post the response is 403 forbidden.

    #130741

    nixadmin
    Participant

    Hello
    I have doublechecked the issue
    we tried to create CURL post request with api-key and side parameters and got next answer

    {"customer":
    {"api_keys":
    {"public":"***************",
    "private":"***************"},
    "domains":["example.com"],
    "is_pro":"17",
    "currently_used_site_slots":0,
    "id":"****",
    "payments":
    {"*****":
    {"ID":*****},
    "***":{"ID":*****},
    "****":{"ID":*****},
    "*****":{"ID":****}},
    "available_sites":5}}

    Also in apache access and errors logs I found this, maybe it can be helpful

    
    
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and body in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): </body> in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string():        ^ in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): Entity: line 7: parser error : Opening and ending tag mismatch: body line 3 and html in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): </html> in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string():        ^ in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): Entity: line 8: parser error : Premature end of data in tag html line 1 in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string():  in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    [Mon Jul 31 08:41:17 2017] [error] [client 127.0.0.1] PHP Warning:  simplexml_load_string(): ^ in /var/www/virtuals/example/tdcwp/wp-content/plugins/inbound-pro/classes/admin/class.inbound-api-wrapper.php on line 116, referer: https://www.theexample.com/wp-admin/admin.php?tab=inbound-pro-setup&page=inbound-pro
    
    #130744

    Hudson Atwell
    Keymaster

    Could you share temp login details privately?

    If your manual CURL requests are working then I wonder why our wp_remote_post call is not working. Maybe the key to solving the error is to check using wp_remote_post and not CURL?

    #130754

    nixadmin
    Participant

    Yes, I can share access for you, but I don’t see any “PM” button 🙁

    Could you help, how to check with wp_remote_post ?

    Thanks

    #130765

    Hudson Atwell
    Keymaster

    When you craft a reply here there should be a checkbox to toggle it private.

    Also to check the connection using wp_remote_post you could momentarily add this to the bottom of the theme’s functions.php file:

    https://gist.github.com/atwellpub/c48a561f5c56c58e25777612398d139e

    #130770

    nixadmin
    Participant

    Hello
    After adding code from github I see error it tab title
    Screenshot attached
    or as text

    
    403 Forbidden<\/title><\/head>\r\n<body bgcolor=\"white\">\r\n<center><h1>403 Forbidden<\/h1><\/center>\r\n<hr><center>nginx<\/center>\r\n<\/body>\r\n<\/html>\r\n","response":{"code":403,"message":"Forbidden"},"cookies":[],"filename":null,"http_response":{"data":null,"headers":null,"status":null}}<!DOCTYPE html>
    <html lang="en-US" prefix="og: http://ogp.me/ns#" class="html_stretched responsive av-preloader-disabled av-default-lightbox  html_header_top html_logo_center html_bottom_nav_header html_menu_right html_custom html_header_sticky html_header_shrinking html_header_topbar_active html_mobile_menu_tablet html_header_searchicon html_content_align_center html_header_unstick_top_disabled html_header_stretch_disabled html_minimal_header html_elegant-blog html_modern-blog html_av-submenu-hidden html_av-submenu-display-click html_av-overlay-side html_av-overlay-side-classic html_av-submenu-noclone html_entry_id_206 html_av_admin_bar_active av-no-preview html_text_menu_active ">
    <head>
    <meta charset="UTF-8" />
    
    <!-- mobile setting -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <!-- Scripts/CSS and wp_head hook -->
    Attachments:
    You must be logged in to view attached files.
    #130788

    Hudson Atwell
    Keymaster

    Yep! That’s what we are trying to debug. Ever time I get this error it’s because of a server settings and my checks show that our host is not blocking the connection.

    #130789

    Hudson Atwell
    Keymaster

    The comments in this article might be useful in finding a solution too:
    https://www.elegantthemes.com/blog/tips-tricks/how-to-fix-403-forbidden-error-in-wordpress

    #130794

    nixadmin
    Participant

    I’m sorry, but this is other issue
    by your URL – if we will have 403 on our website, but I see “403 forbidden nginx”
    We haven’t nginx on this server, also I don’t see any 403 errors from server logs

    Also, from your code (https://gist.github.com/atwellpub/c48a561f5c56c58e25777612398d139e)
    I have changed echo json_encode($response);
    to
    var_dump($response);
    and got next error

    as text

    
    array(6) { ["headers"]=> object(Requests_Utility_CaseInsensitiveDictionary)#2464 (1) { ["data":protected]=> array(4) { ["server"]=> string(5) "nginx" ["date"]=> string(29) "Thu, 03 Aug 2017 07:04:39 GMT" ["content-type"]=> string(9) "text/html" ["content-length"]=> string(3) "162" } } ["body"]=> string(162) "
    403 Forbidden
    nginx
    " ["response"]=> array(2) { ["code"]=> int(403) ["message"]=> string(9) "Forbidden" } ["cookies"]=> array(0) { } ["filename"]=> NULL ["http_response"]=> object(WP_HTTP_Requests_Response)#2460 (5) { ["response":protected]=> object(Requests_Response)#2461 (10) { ["body"]=> string(162) "
    403 Forbidden
    nginx
    " ["raw"]=> string(305) "HTTP/1.1 403 Forbidden Server: nginx Date: Thu, 03 Aug 2017 07:04:39 GMT Content-Type: text/html Content-Length: 162 Connection: close
    403 Forbidden
    nginx
    " ["headers"]=> object(Requests_Response_Headers)#2462 (1) { ["data":protected]=> array(4) { ["server"]=> array(1) { [0]=> string(5) "nginx" } ["date"]=> array(1) { [0]=> string(29) "Thu, 03 Aug 2017 07:04:39 GMT" } ["content-type"]=> array(1) { [0]=> string(9) "text/html" } ["content-length"]=> array(1) { [0]=> string(3) "162" } } } ["status_code"]=> int(403) ["protocol_version"]=> float(1.1) ["success"]=> bool(false) ["redirects"]=> int(0) ["url"]=> string(45) "https://www.inboundnow.com/pro-api/key/check/" ["history"]=> array(0) { } ["cookies"]=> object(Requests_Cookie_Jar)#2459 (1) { ["cookies":protected]=> array(0) { } } } ["filename":protected]=> NULL ["data"]=> NULL ["headers"]=> NULL ["status"]=> NULL } }
    

    or as screenshot in attach

    Also

    
    $ curl -I https://www.inboundnow.com/pro-api/key/check/ -v
    *   Trying 35.185.62.238...
    ***********
    < HTTP/1.1 401 Unauthorized
    HTTP/1.1 401 Unauthorized
    < Server: nginx
    Server: nginx
    

    It seems this is forbidden from your server https://www.inboundnow.com/pro-api/key/check/
    Or am I wrong?

    Thanks

    Attachments:
    You must be logged in to view attached files.
Viewing 15 posts - 1 through 15 (of 31 total)

The topic ‘[Account Management] Api Key don't work’ is closed to new replies.