Jump to content

Something block response form POST and GET call


Marco Ro
 Share

Recommended Posts

Hello everyone,
there is something blocking the responses of POST and GET calls.

I don't know what to do, the call tried on postman works.
And also from a site with an older version of ProcessWire.

I can't figure out what it is that's blocking the response.
All I get is this error:

`Failed to connect to auth.giobby.com port 443: Connection timed out`

What I can do? 

Link to comment
Share on other sites

Just issued a simple GET request to the provided domain and it redirected (without error) to what I suspect is an expected subfolder. So...either it's working as expected now, it's an issue with your network/computer (and is working), or perhaps you're not taking into consideration URL forwarding from rewrite rules (whereas Postman likely is)?

  • Like 2
Link to comment
Share on other sites

11 hours ago, BrendonKoz said:

issue with your network/computer

Thank you for your help!
I'm quite sure that problem is in the server, because I just try with another server provider (chipper one) and everything works well.
How could I check if is the server ?

Link to comment
Share on other sites

@Marco Ro get and post also works from here, at least we receive http answer code, like  @BrendonKoz 

Also, FYI if it help, GET request on HTTP get redirected to /auth from the js code (window.location.href = "/auth/") and the same request on HTTPS is forbidden.

 

  

1 hour ago, Marco Ro said:

OVH 😤 How can I unblock the port? 

On a VPS or private server, you have to adjust the firewall from the OVH dashboard. If it's an hosting plan, then you have nothing to do.

https://docs.ovh.com/it/dedicated/firewall-network/#prerequisiti

  • Like 2
Link to comment
Share on other sites

I dont get it Marco, did you manage the  server or its an hosting plan ? 
 

Because as we said, as we can send requests on 80 and 443, there is no firewall blocking it. 
 

One thing you could ask them or check on the logs, is if your ip get blocked somewhere, they have antiddos mesures and you might had a bad loop throwing requests during a small period, thats just a idea..

Link to comment
Share on other sites

On 12/7/2022 at 5:44 PM, flydev said:

no firewall blocking it. 

Problem is not on the auth.giobby.com side. The problem is in my server, where is store the e-commerce www.playwood.it 
I need response with the access token and not arrive because my port is close. (I think)

I just change the provider from siteground to OVH, add look like the OVH with my current plane not give me the ability to setup the ports. I try to deleted the firewall but probably OVH have some security setup that not open the door by default. 

Link to comment
Share on other sites

@flydev @BrendonKoz sorry, maybe I didn't understand what you tell me.

Look like server side is all good, the port 443 is open. But I still to not understand way I can't get the answer from the call.

You say that  HTTPS is forbidden. But have I to configure Processwire to use HTTP for this call ?

I can't understand where is the problem, I have this call, that start from playwood.it and go to https://auth.giobby.com/auth/...

I just test with Postman and works, test with other server and other CMS and works, in my past Processwire website works but was a old PW version and other server.
 

		$auth = array(
            "grant_type" => 'password',
            "client_id" => 'PLA591WOD-playwoodsrl',
            "username" => 'demo-dev',
            "cid" => 'playwoodsrl',
            "password" => 'DemoPassword'
		);

		$dati = '';
		foreach ($auth as $k => $v) {
		 	$dati .= $k . '=' . urlencode($v) . '&';
		}
		rtrim($dati, '&');

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, 'https://auth.giobby.com/auth/realms/api-server/protocol/openid-connect/token');
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_TIMEOUT, 30);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $dati);
		$result = curl_exec($ch);
		$error = curl_error($ch);
		curl_close($ch);
	 	$result_obj = json_decode($result);
		$tokenGiobby = $result_obj->access_token;

  

Link to comment
Share on other sites

Unfortunately I don't know anything about OVH. That knowledge might be needed here...

If I can reach 'https://auth.giobby.com' in a web browser (GET request) without error, and you're saying that Postman works - then I would have to think everything is configured properly on the server that is handling the authentication portion of your server/code.

Considering that, I'd be focusing on playwood.it to see if/why there are issues from there. You could enable debugging in your cURL call:

curl_setopt($ch, CURLOPT_VERBOSE, 1);

If there's an error, you can review that from your unused variable ($error), and/or check your server/php error logs. From using your code above, however, I was able to get a successfully retrieved value for access_token on my local machine's development/test server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...