x

Integration question (for developers): Custom parameters in redirect_uri?

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 🙂

721 Views
Message 1 of 2
Report
1 REPLY 1
Square Community Moderator

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.

Ashley C
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
682 Views
Message 2 of 2
Report