XeroAPI/Xero-Net — pull request #17 by paulblamire (2014-08-07 20:17:12+00:00)
Title: AuthorizationHeader string handling causing OAuth failures

When using the Private Application sample code I was receiving an OAuth error.

Failed to validate signature: (http://developer.xero.com/documentation/getting-started/oauth-issues/)
oauth_problem=signature_invalid&oauth_problem_advice=Failed to validate signature

I eventually tracked down the problem to Realm and Callback being included in the Authorization Header even though they were not set

I therefore propose the following changes to the AuthoizationHeader class to prevent the values being appended if not set:

1) Change HasRealm to use IsNullOrWhiteSpace
2) Added guard clause to ToString so that {ParamName}="" is not output if
{ParamValue} is not present

This change fixes the issue for me locally, tested against demo account

This is my first pull request so go easy :-)

Paul