OAuth 2.0 with JWT with PHP
Hello, I know it is duplacated, previous one was mark as solved but it wasn't.
"Solved" answer was linked to https://developer.box.com/docs/community-supported-projects where is no example of that.
So my question is, is there any example / quick solution to create Access Token using PHP ?
Im trying to run https://codepen.io/box-platform/pen/wdWWdN , I must create app that is authenticated by server, not by user, users log into another system, and they just must see and download, upload (depending of permissions) some documents.
Using User auth I think it is not a smart idea to use same user (Because I don't want to user use their account, they should not have any account) token but refresh token to every "other" user.
Every time im getting new refresh token so I will have to .... not ideal solution ?
Im also tried App Token ( https://developer.box.com/docs/getting-started-with-new-box-view#section-generate-an-app-token-through-the-developer-console ) but in this case I just see "no files", no errors etc but there is not files.
Configuration :
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.box.com/oauth2/token", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "subject_token=dufsSCQkiW5XnTl3C7KKCd9LdKrcHaer&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&scope=item_preview%20item_upload&resource=https%3A%2F%2Fapi.box.com%2F2.0%2Ffolders%2F0&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", "content-type: application/x-www-form-urlencoded", "postman-token: 15f4f19c-8238-e13a-3236-083980a7ad41" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl);
サインインしてコメントを残してください。
コメント
2件のコメント