0 Replies Latest reply on Aug 16, 2017 1:15 AM by npanta@italentcorp.com

    How to reduce oauth2 access token receiving time

    npanta@italentcorp.com

      Hi all,

      One of our web application is using our internal jive community for authentication using oauth2 We followed OAuth 2.0  document and implemented authentication. We are using php-curl for getting access token, refresh token, expires_in

      <?php

           $code = $_GET['code'];

           $client_id="****client id***";

          $client_secret="****client secret****";

          $handle = curl_init('https://******.jiveon.com/oauth2/token');

          $oauth=array();

          $data = array('grant_type' => 'authorization_code', 'client_id' => $client_id, 'code' => $code);

       

          curl_setopt($handle, CURLOPT_POST, true);

          curl_setopt($handle, CURLOPT_USERPWD, $client_id.":".$client_secret);

          curl_setopt($handle, CURLOPT_POSTFIELDS, $data);

          curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

          $resp = curl_exec($handle);

          var_dump($resp);

      ?>

       

      this curl call is taking almost 6-7 seconds to give the response.

      Is there any way to get faster.

       

      Thanks,

      Narsi