I’m implementing Square OAuth flow in my .NET MVC application using the sandbox environment. However, when I try to connect, I get redirected to a blank page instead of the Square authorization screen.
Here’s the code I’m using to generate the OAuth URL and redirect:
private const string ClientId = “sandbox-sq0idb-2fOIpoGtJ2dv7s0eyvV0AQ”;
private const string ClientSecret = “sandbox-sq0csb-_oWmr1PoIO8x_dQL10-_cn-kTmySHiWOtf1icERlcF8”;
private const string RedirectUri = “http://localhost:5237/Square/Callback”;
var state = Guid.NewGuid().ToString();
var url = $“https://connect.squareupsandbox.com/oauth2/authorize?” +
$“client_id={ClientId}” +
$“&scope=MERCHANT_PROFILE_READ%20PAYMENTS_READ” +
$“&session=false” +
$“&state={state}” +
$“&redirect_uri={Uri.EscapeDataString(RedirectUri)}”;
return Redirect(url);
any one please tell me whats wrong with this code