Youjun Lee Posted January 11, 2023 Posted January 11, 2023 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); ?>
Marc Posted January 11, 2023 Posted January 11, 2023 You need to ensure you are sending a user agent, or it would indeed be blocked there
Recommended Posts