Jump to content

Recommended Posts

Posted

Could contain: Page, Text

 

I've got issue to get access token. 

Above capture image is my redirectURL and I use curl to get accesstoken. 

<?php
 
$CLIENT_ID = "d90XXXXXXXXXXXXXX";
$REDIRECT_URI = "http://localhost:8080/callback.php";
$TOKEN_API_URL = "https://XXXXXXXX.invisionservice.com/oauth/token/";
 
$code = $_GET["code"];
$params = sprintf( 'grant_type=authorization_code&client_id=%s&redirect_uri=%s&code=%s', $CLIENT_ID, $REDIRECT_URI, $code);
 
$opts = array(
CURLOPT_URL => $TOKEN_API_URL,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSLVERSION => 1, // TLS
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false
);
 
$curlSession = curl_init();
curl_setopt_array($curlSession, $opts);
$accessTokenJson = curl_exec($curlSession);
curl_close($curlSession);
 
print_r($accessTokenJson);
?>
  • Recently Browsing   0 members

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