calcinai/oauth2-xero

XeroTenant is actually a connection, not a tenant

Opened this issue · 1 comments

This model is named XeroTenant:

https://github.com/calcinai/oauth2-xero/blob/master/src/XeroTenant.php

For people coming new to this provider, that can be somewhat confusing, since it does not represent a tenant. It is the Xero connection model - the linking model, or pivot model, providing the many-to-many join between the resource owners (aka users) and the tenants (usually organisations).

Ideally this model would have a different name, IMO. That would be a breaking change, that you would not want to do, but would it be worth making this clearer in the documentation?

Simialarly, the "access token" returned by the driver is not actually the access token, but what Xero call the "token set", which consists of an access token, renewal token, expiry, list of scopes, and optional identifier token. It's confusing but kind of hard-coded into the League parent library now, so difficult to change. It is confusing having the need to get the access token from the "access token", and the identity token also from the "access token", mainly because the access token fetched by getAccessToken() is not actually an access token, which needs to be understood. Again, unless it is just me being easily confused by naming, would a section in the documentation help?

If you'd like to update the readme, feel free! I've tried to keep this provider consistent with the other providers but may have missed something!