Passing Data to Redirect on 0Auth

Hello,
I have the following 0Auth URL.
https://squareup.com/oauth2/authorize?client_id=s000-000-000-&scope=PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS+PAYMENTS_WRITE+PAYMENTS_READ+PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS+ORDERS_READ+ORDERS_WRITE+DEVICE_CREDENTIAL_MANAGEMENT&state=82201dd8d83d23cc8a48caf52b

It redirects to the following URL [Preformatted text](https://webhook.site/3ca6dc1f-79ed-42b2-8ddf-664cfa5?code=000-000-00-&response_type=code&state=82201dd8d83d23cc8a48caf52b#_=_)

My question is, see how it returns &code=000-000-000 by default? Is it possible that in the original authorization 0auth link I sent how can I pass an extra parameter in the URL that will be sent to the redirect URL? I want to do the following [Preformatted text](https://squareup.com/oauth2/authorize?client_id=s000-000-000-&scope=PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS+PAYMENTS_WRITE+PAYMENTS_READ+PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS+ORDERS_READ+ORDERS_WRITE+DEVICE_CREDENTIAL_MANAGEMENT&state=82201dd8d83d23cc8a48caf52b&**UUID=111-111-11**1)

I want the redirect to look like the following

[type or paste code here](https://webhook.site/3ca6dc1f-79ed-42b2-8ddf-664cfa5?code=000-000-00-&response_type=code&state=82201dd8d83d23cc8a48caf52b#_=_&UUID=111-111-111)

How can I do this?

Currently sending an additional parameter in the URL that’s included in the redirect URL isn’t currently possible. :slightly_smiling_face:

OAuth standards do not allow you to change the URL string outside of the state parameter.

This is not a square issue but just the way OAuth works. All good OAuth 2.9 flows should have this requirement.

The state parameter is the only url attribute you can set and get back on the return url.

If you need 4 or 5 variables typically what we do is json encode the variables you need, then base 64 encode then and set that entire string as the state parameter.

Then when square gives the state parameter back on the return page you base 64 decode it, and json decode it back into multiple attributes you want to track across the flow.

1 Like

As Rypay191 says so clearly, it’s possible to send multiple variables through the “state” parameter, that’s how I do it. You don’t need an additional parameter to send extra variables.