Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Xero integration using OAuth 2.0

Featured Replies

Hi all.

I need to upgrade my Xero integration to use OAuth 2.0 and I'm struggling with 1 element.

I have my Client Id and Client Secret and I can get an Authorization Code but I can't then get the required token.

The Xero documentation says the token request requires:

POST https://identity.xero.com/connect/token
authorization: "Basic " + base64encode(client_id + ":" + client_secret)
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code=xxxxxx
&redirect_uri=https://myapp.com/redirect

My request always returns {"error":"invalid_client"}

I'm using an insert from URL with the following cURL options:

"-X POST" &

" -H \"Content-Type: application/x-www-form-urlencoded\"" &

" -H \"Authorization: \"Basic \""& Base64Encode (ACT_SET::ClientId &":"& ACT_SET::ClientSecret) & "\"" &

" --data-urlencode grant_type=authorization_code" & ¶ & 
" --data-urlencode code="&ACT::AuthorizationCode&¶ & 
"--data-urlencode redirect_uri=https://xxxxxxx.com/"

I'm assuming the issue lies in the syntax of " -H \"Authorization: \"Basic \""& Base64Encode (ACT_SET::ClientId &":"& ACT_SET::ClientSecret) & "\"" & but I've tried everything I can think of and I'm getting no further.

 

Any help would be much appreciated.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.