Hey there anyone who has linked to Xero…
(@sitestreet, @scalaris, @Roney_Dsilva, @teodor (of course) and others…)
I seem to be stuck at the last part of getting my Xero login process working using the OAuth2 Provider… and I’d love a bit of help with it!
I’ve got it all working manually where I get the token from Xero’s ‘code’, so I know I’m close…
Manual Setup - That Works
So doing it manually, I have the first step of opening a browser window which links to the authorize api:
https://login.xero.com/identity/connect/authorize?response_type=code&client_id=8F.....46&redirect_uri=https://app.workshop-angel.com&scope=offline_access accounting.transactions accounting.contacts accounting.settings&state=x
This works and give me the code
in the url of my redirect_uri.
At the moment I paste that code
into a variable in a server action which then generates the access_token. The token is stored in a session variable, and I can then use that to go off and and work with the Xero API:
OAuth2 Provider Setup - Doesn’t Work
So as I understand, the Wappler OAuth2 Provider does both these steps in one… so somewhere in that setup I need to specify the right information.
Here is my OAuth2 Provider:
The redirect_uri path is: http://localhost/dmxConnect/api/external_api/xero_login.php
, which is where I’m calling it from. Here is the call:
But however I organise the params section of this, I am getting the same CORS error on the first authorization step:
Can anyone help me understand how to fix this please? Thank you!
PS - here are my redirect URIs in Xero…