美好的一天,
我在获取访问令牌方面遇到了麻烦.我按照这里的指南:http://developers.box.com/oauth/ 已经获取我的client_id,client_secret,并在应用程序设置(OAuth2参数)部分设置redirect_uri.
这是client.php文件的代码
<?php
$client_id = 'my_client_id_here'; //removed
$post_url = 'https://www.box.com/api/oauth2/authorize';
include 'includes/header.php';
?>
<div id="content">
<form action="<?php echo $post_url; ?>" type="POST" enctype="application/x-www-form-urlencoded">
<input type="text" name="response_type" value="code">
<input type="text" name="client_id" value="<?php echo $client_id; ?>">
<input type="text" name="state" value="vexhax97td8xf_SomeTemporaryValueForTesting">
<input type="submit">
</form>
<div id="response"></div>
</div>
<?php
include 'includes/footer.php';
?>
Run Code Online (Sandbox Code Playgroud)
这里是文件的代码something.php(这是redirect_uri将去的地方)
<?php
$client_id = 'my_client_id_here'; //removed
$client_secret = 'my_client_secrect_here'; //removed
$post_url = 'https://www.box.com/api/oauth2/token';
$code …Run Code Online (Sandbox Code Playgroud)