# Clarification on OAuth flow for Mobile Payments SDK

**URL:** <https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572>\
**Category:** Questions\
**Tags:** reader-sdk, mobile-payments-sdk\
**Created:** [November 19, 2025, 10:50am UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572 "2025-11-19T10:50:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dishumskaya](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dishumskaya](https://developer.squareup.com/forums/u/dishumskaya)\
**Post date:** [November 19, 2025, 10:50am UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572/1 "2025-11-19T10:50:58Z")

</div>

Hello,

I’m a bit confused about the intended OAuth flow for the Mobile Payments SDK.

> **[Migrate from the Reader SDK](https://developer.squareup.com/docs/mobile-payments-sdk/migrate#oauth-authentication)**
>
> Learn how to migrate applications from the Reader SDK to use the Mobile Payments SDK.

In the migration guide it looks like each store (location) should authorize directly inside the mobile app. However, the [documentation](https://developer.squareup.com/docs/mobile-payments-sdk/ios/configure-authorize#session-expiration) also says that Square recommends tracking `expires_at` on the server and refreshing tokens before they expire - which suggests that the main authorization flow should happen once on the backend, and the mobile app should only receive a valid access token:

> Square recommends tracking the expires\_at value on your server and refreshing the authorization token before it expires. You can store expiration time on the device and check it during application initialization.

Could you please clarify the correct approach for production apps? Is the recommended approach that every mobile app instance should perform OAuth authorization itself, or is it better to authorize once via a web flow (on our server), store and refresh the token server-side, and then provide the mobile app with a valid access token?

---

<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:** [November 19, 2025, 10:51am UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572/2 "2025-11-19T10:51:09Z")

</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 API](https://developer.squareup.com/docs/oauth-api/how-it-works)**
>
> The OAuth API lets you request permissions from Square sellers to manage their resources and get access tokens to call Square APIs on their behalf.

> **[OAuth API](https://developer.squareup.com/docs/oauth-api/how-oauth-works)**
>
> The OAuth API lets you request permissions from Square sellers to manage their resources and get access tokens to call Square APIs on their behalf.

> **Additional Documentation**
>
> [OAuth API](https://developer.squareup.com/docs/oauth-api/what-it-does)  
> [OAuth API](https://developer.squareup.com/docs/oauth-api/overview)  
> [Authorize the Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk/ios/configure-authorize)

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:** [November 19, 2025, 6:55pm UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572/3 "2025-11-19T18:55:25Z")

</div>

There is two levels of authorizations here. The first is OAuth, and if your app is for many sellers to use then they have to OAuth to your application and you get an access token that needs to be refreshed on a regular cadence.

The second is with the `AuthorizationManager` which handles authorizing and deauthorizing your application to process payments on behalf of a Square seller using an [OAuth access token](https://developer.squareup.com/docs/oauth-api/what-it-does) and a [location ID](https://developer.squareup.com/docs/locations-api) within the app. 🙂

---

<div class="post-metadata">

**Author:** ![dishumskaya](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@dishumskaya](https://developer.squareup.com/forums/u/dishumskaya)\
**Post date:** [November 19, 2025, 7:31pm UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572/4 "2025-11-19T19:31:12Z")

</div>

Thanks for the response!

Just to clarify — I understand the difference between:

1. **OAuth authorization** (merchant logs in, app gets access\_token + refresh\_token)

2. **AuthorizationManager** inside the Mobile Payments SDK (authorizing the SDK using an already obtained OAuth access token + location ID)

My question is specifically about **OAuth** , not AuthorizationManager.

According to the documentation for Mobile Payments SDK, Square recommends keeping track of expires\_at on the server and refreshing the OAuth token before it expires. This suggests that the recommended production architecture is:

**OAuth → done once on the backend (server-side),**

**Server stores and refreshes OAuth tokens,**

**Mobile app only receives a short-lived access token to pass into AuthorizationManager.**

Could you please confirm whether this is the recommended approach for production apps?

- Should OAuth happen **on the server** , and the mobile app should only receive a valid short-lived access token?

Or:

- Is Square expecting that **each mobile app instance** should perform the full OAuth flow itself using PKCE?

I want to make sure our architecture matches Square’s intended production use.

---

<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:** [November 19, 2025, 7:53pm UTC](https://developer.squareup.com/forums/t/clarification-on-oauth-flow-for-mobile-payments-sdk/24572/5 "2025-11-19T19:53:04Z")

</div>

OAuth should alway happen on the server side and all values returned should be stored on the server side.

The server only passes the access token when calling the AuthorizationManager to authorize the app and the access token should **NOT** be stored on the app itself. 🙂
