In previous posts, we demonstrated connecting to Xero using only an OAuth 2.0 library. We’ve provided examples in NodeJS, Java, .NET, Ruby, GoLang and in this post we look at PHP. What are some reasons a developer might choose to build with just an OAuth 2.0 library and not the official Xero PHP SDK?
On line 6–8 we set our $clientId, $clientSecret and $redirectUri to match our Xero OAuth 2.0 application we created.
Refresh your browser to execute this updated code and you should go through the OAuth flow and return back to your application.