With the globally set redirect url in the dashboard, how can I detect on my server, which user it is who has authorised my app to access Square on their behalf, after directing them to the oauth2/authorize endpoint?
With other integrations I've done, it's possible to specify a redirect url on a case-by-case basis, in which I include custom parameters in the query string.
Many thanks in advance for any advice 🙂
Hey @SqDeveloper! Welcome to the Community.
I reached out to the API team with this and they replied with the following:
After they authorize (oauth2/authorize) they will pass the code they receive to ObtainToken. The response from ObtainToken will include things such as a merchant_id that would help them identify who it was that just authed (https://developer.squareup.com/reference/square/oauth-api/obtain-token). Also once they auth successfully, they can of course use the access token to call the APIs such as ListLocations which will return things like the business name: https://developer.squareup.com/reference/square/locations-api/list-locations.
Square Community