# Getting Blank Page While Trying to Connect Square OAuth (Sandbox)

**URL:** <https://developer.squareup.com/forums/t/getting-blank-page-while-trying-to-connect-square-oauth-sandbox/22224>\
**Category:** Questions\
**Created:** [May 8, 2025, 5:46am UTC](https://developer.squareup.com/forums/t/getting-blank-page-while-trying-to-connect-square-oauth-sandbox/22224 "2025-05-08T05:46:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naveenchk](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Naveenchk](https://developer.squareup.com/forums/u/Naveenchk)\
**Post date:** [May 8, 2025, 5:46am UTC](https://developer.squareup.com/forums/t/getting-blank-page-while-trying-to-connect-square-oauth-sandbox/22224/1 "2025-05-08T05:46:27Z")

</div>

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](http://localhost:5237/Square/Callback)”;

var state = Guid.NewGuid().ToString();

var url = $“[https://connect.squareupsandbox.com/oauth2/authorize?](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

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [May 8, 2025, 5:46am UTC](https://developer.squareup.com/forums/t/getting-blank-page-while-trying-to-connect-square-oauth-sandbox/22224/2 "2025-05-08T05:46:50Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[OAuth Walkthrough: Test Authorization with Web Server](https://developer.squareup.com/docs/oauth-api/build-with-oauth)**
>
> Learn how to build a Square OAuth API flow to authorize your application to access a Square account.

[https://developer.squareup.com/docs/oauth-api/walkthrough2](https://developer.squareup.com/docs/oauth-api/walkthrough2)

> **Additional Documentation**
>
> [OAuth Walkthrough: Test Authorization with Web Server](https://developer.squareup.com/docs/oauth-api/walkthrough)  
> [Square .NET SDK Quickstart](https://developer.squareup.com/docs/sdks/dotnet/quick-start)  
> [Create the Redirect URL and Square Authorization Page URL](https://developer.squareup.com/docs/oauth-api/create-urls-for-square-authorization)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [May 8, 2025, 3:42pm UTC](https://developer.squareup.com/forums/t/getting-blank-page-while-trying-to-connect-square-oauth-sandbox/22224/3 "2025-05-08T15:42:01Z")

</div>

Is the sandbox Seller Dashboard open in another tab when testing the OAuth flow in sandbox? It’s a requirement in sandbox. 🙂
