nsx_trOAuthSignatureMethod_PLAINTEXT

The PLAINTEXT method does not provide any security protection and SHOULD only be used over a secure channel such as HTTPS.

Defined (1)

The class is defined in the following location(s).

/inc-cl/apis/OAuth.php  
  1. class nsx_trOAuthSignatureMethod_PLAINTEXT extends nsx_trOAuthSignatureMethod { 
  2. public function get_name() { 
  3. return "PLAINTEXT"; 
  4.  
  5. /** 
  6. * oauth_signature is set to the concatenated encoded values of the Consumer Secret and  
  7. * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is  
  8. * empty. The result MUST be encoded again. 
  9. * - Chapter 9.4.1 ("Generating Signatures") 
  10. * Please note that the second encoding MUST NOT happen in the SignatureMethod, as 
  11. * OAuthRequest handles this! 
  12. */ 
  13. public function build_signature($request, $consumer, $token) { 
  14. $key_parts = array( 
  15. $consumer->secret,  
  16. ($token) ? $token->secret : "" 
  17. ); 
  18.  
  19. $key_parts = nsx_trOAuthUtil::urlencode_rfc3986($key_parts); 
  20. $key = implode('&', $key_parts); 
  21. $request->base_string = $key; 
  22.  
  23. return $key;