Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

Ignore callback parameter (config with localhost)

Started by lelong clemence -   in API Authentication

I have a public application, I use xero_gateway in Rails to ask for a connection authorisation but it seems that Xero ignore my parameter oauth_callback so I get the verification code and it doesn't go back to my application. In Xero, I configure it with http://localhost:3000 and no callback (or I tried localhost without success too).
My oauth parameter = localhost:3000/mymethod
What did I do wrong?

On the xero_gateway README file, there is an explanation on how to specify the callback parameter.

Something like this:
redirect_to request_token.authorize_url(:oauth_callback => "http://www.something.com/xero/complete")

Can you clarify whether you have specified the callback parameter as shown above?

W. Abdullah (Community Manager)  

Yes here is my log :
Redirected to https://api.xero.com/oauth/Authorize?oauth_callback=http%3A%2F%2Flocalhost%3A3000%2Fawsaccounts%2F1%2Fxero_sessions%2Fcreate_session&oauth_token=6
so it is htttp://localhost:3000/....
and my configuration in Xero is : http://localhost:3000/ and no callback url option.

lelong clemence  

The documentation for this library is incorrect, you need to implement the callback url at the requestToken stage, not Authorize:
request_token(:oauth_callback => "http://www.something.com/xero/complete")

Ronan Quirke (Community Manager)