Closed Vimiso closed 4 years ago
Good question!
Currently the package is pretty well tied to the current credential manager, but I'm open to it not being.
Swapping the credential manager out for an interface and then binding the current credential manager to that interface would be the way to go and should be pretty easy. Unfortunately due to Covid-19 we're pretty swamped so would be unlikely to be able to contribute this until early next month. I'll leave this issue open as a reminder, but feel free to send through a PR if you'd like it earlier!
Just wondering if there has been any progress on this issue?
Makes using Xero unusable for a one organisation tied to a project (effectively the old Private app style), especially after the cache being cleared on each deploy.
Hey everyone,
I've just published v2.0.0 which will now allow this. In addition to allowing you store the credentials wherever you want, we are now storing the credentials in a file in storage/framework/xero.json by default so it won't get wiped when you clear the cache.
You'll want to republish the config file and then reauthenticate, apart from that it should be a seamless upgrade.
See https://github.com/webfox/laravel-xero-oauth2#credential-storage for docs on how to swap out the credential manager
//cc @Vimiso, @benjaminbowles, @bradleybensmith, @bilalswiftsolutions, @discoveryjames
Thanks very much - could you update your XeroController.php example - at the moment it currently doesn't show the connected credentials after upgrading and reconnecting.
Also it would be good if you could show your suggested handling of renewing expired tokens using refresh_tokens that are stored?
Thanks very much - could you update your XeroController.php example - at the moment it currently doesn't show the connected credentials after upgrading and reconnecting.
Also it would be good if you could show your suggested handling of renewing expired tokens using refresh_tokens that are stored?
@benjaminbowles did you manage to swap out the credential manager to store in the database and not file storage? Also looking for an example if this was to be stored against a user in model (or belongs to relation) in Laravel
In an app I'm working on I want to be able to swap out the
OauthCredentialManager
for my own because I want to store the tokens in the database against an authenticated user rather than using Laravel's cache / session.Can this be easily done using our own XeroServiceProvider, because I see there are places where the package uses OauthCredentialManager directly.