function get_auth_header in Dropbox Client 7.4
Same name and namespace in other branches
- 7 oauth.php \get_auth_header()
- 7.2 oauth.php \get_auth_header()
- 7.3 oauth.php \get_auth_header()
Creates the authorization portion of a header NOTE: This does not create a complete http header. Also NOTE: the oauth_token parameter should be passed in using the $extra array.
Parameters
string $baseurl the base url we are authenticating against.:
string $key your consumer key:
string $secret either your consumer secret key or the file location of your rsa private key.:
array $extra additional oauth parameters that should be included (you must urlencode a parameter, if appropriate, before calling this function):
string $method either GET or POST:
string $algo either HMAC-SHA1 or RSA-SHA1 (NOTE: this affects what you put in for the secret parameter):
Return value
string the header authorization portion with trailing \r\n
2 calls to get_auth_header()
- dropbox::get_access_token in ./
dropbox.php - This is called to finish the oauth token exchange. This too should only need to be called once for a user. The token returned should be stored in your database for that particular user.
- dropbox::_build_header in ./
dropbox.php
File
- ./
oauth.php, line 182
Code
function get_auth_header($baseurl, $key, $secret, $extra = array(), $method = 'GET', $algo = OAUTH_ALGORITHMS::RSA_SHA1, $token_key = NULL, $token_secret) {
$auth = build_auth_array($baseurl, $key, $secret, $extra, $method, $algo, $token_key, $token_secret);
return build_auth_string($auth);
}