Good afternoon,
I have been struggling to get my authentication url working for my external application. I’m currently working in a sandbox environment, in which I have a test user on my application try to connect with the redirect url to make an oauth token exchange.
The first few times I ran it, I got to the squareup screen that asked for username and password. Unsure what to do, I put my dev email in and password. got denied. Then I tried it again with the fake sandbox account, then didn’t know what password to use - of course then could not make the connection.
Now whenever I try again I get the unable to find client by that client_id error.
Here’s my endpoint code from python:
def get_square_auth_url(request: Request):
scopes = ['MERCHANT_PROFILE_READ', 'ORDERS_READ', 'CUSTOMERS_READ']
state_string = generate_state_string() # Add or remove scopes as needed
request.session['oauth_state'] = state_string
auth_url = (
f"https://connect.squareup.com/oauth2/authorize"
f"?client_id={square_application_id}"
f"&scope={' '.join(scopes)}"
f"&response_type=code"
f"&redirect_uri={square_redirect_uri}"
f"&state={state_string}"
)
print("constructed auth url: ", auth_url)
return auth_url
and the url that appears in my browser
I have tried both with and without a state string with the same error appearing. So I’m now really questioning if square is reading my app ID correctly? It appears correctly in my url when the endpoint is hit
1 post - 1 participant