You are here

function build_auth_string in Dropbox Client 7

Same name and namespace in other branches
  1. 7.4 oauth.php \build_auth_string()
  2. 7.2 oauth.php \build_auth_string()
  3. 7.3 oauth.php \build_auth_string()

Assembles the auth params array into a string that can be put into an http header request.

Parameters

array $authparams the oauth parameters:

Return value

string the header authorization portion with trailing \r\n

1 call to build_auth_string()
get_auth_header in ./oauth.php
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.

File

./oauth.php, line 104

Code

function build_auth_string(array $authparams) {
  $header = "Authorization: OAuth ";
  $auth = '';
  foreach ($authparams as $key => $value) {

    //Don't include token secret
    if ($key != 'oauth_token_secret') {
      $auth .= ", {$key}=\"{$value}\"";
    }
  }
  return $header . substr($auth, 2) . "\r\n";
}