Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

Response Status = 401 : oauth_problem=signature_invalid&oauth_problem_advice=Failed to validate sig

Started by Don Whiteside -   in API Authentication

Hi
I get a Response Status = 401 : oauth_problem=signature_invalid&oauth_problem_advice=Failed to validate signature, when requesting the AuthToken.
Both Previous Steps completed OK (1: RequestToken; 2: Authorize App)
Here's my Request and URL
url = https://api.xero.com/oauth/AccessToken?oauth_verifier=1499498
OAMutableURLRequest *request = [[OAMutableURLRequest alloc]
initWithURL:url
consumer:oaConsumer
token:token
realm:nil
signatureProvider:nil]; // use the default method, HMAC-SHA1
oaConsumer = the Consumer Key and Consumer Secret
token = the Request Token obtained in Step 1.

Anyone with an idea of the issue?
Best Reply
Ok Problem Solved.
I had understood the the oauth_verifier should be appended to the URL as follows
https://api.xero.com/oauth/AccessToken?oauth_verifier=123456
However this is not the case.
When using the oauthconsumer library for iOS you need to set the 'verifier' var in OAToken to the Verifier Code and remove it from the URL. The latest oauthconsumer code has provision for the verifier code, there are some blogs that provide a way of adding the support, but these are not required if you have the latest oauthconsumer codebase
 

Don Whiteside