Sebastião Assunção
11/12/2025, 6:32 PMNick Rodriguez
11/13/2025, 5:25 PM404 Token not found. You can also set forceRefresh:true to have Descope refresh on your behalf.Sebastião Assunção
11/13/2025, 5:27 PMNick Rodriguez
11/13/2025, 5:31 PMforceRefresh set for this app? That should resolve the issue with token expiration/connection vanishing.Sebastião Assunção
11/13/2025, 6:17 PMNick Rodriguez
11/13/2025, 6:20 PMforceRefresh is set at runtime when you fetch the outbound token. There isn’t an app-level toggle.Sebastião Assunção
11/13/2025, 6:21 PMSebastião Assunção
11/13/2025, 6:21 PMNick Rodriguez
11/13/2025, 6:29 PMSebastião Assunção
11/14/2025, 11:01 AMSebastião Assunção
11/14/2025, 3:45 PMSebastião Assunção
11/14/2025, 4:08 PM@requires_initialization
async def get_outbound_token(self, app_id: str, descope_internal_entity_id: str, scopes: list[str] | None = None, with_refresh_token: bool = True, force_refresh: bool = True) -> dict[str, Any] | None:
url = "https://api.descope.com/v1/mgmt/outbound/app/user/token/latest"
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {self.project_id}:{self.management_key}"}
payload: dict[str, Any] = {
"appId": app_id,
"userId": descope_internal_entity_id,
# "scopes": scopes or [],
"options": {"withRefreshToken": with_refresh_token, "forceRefresh": force_refresh},
}
try:
async with httpx.AsyncClient() as client:
response = await client.post(url, headers=headers, json=payload)
if response.status_code != 200:
logger.debug(f"Failed to get outbound token for app_id={app_id}, entity_id={descope_internal_entity_id}. Status: {response.status_code}, Response: {response.text}")
return None
data = response.json()
return data["token"]
except Exception as e:
logger.error(f"Failed to get outbound token for app_id={app_id}, entity_id={descope_internal_entity_id}: {e}")
return None
This was working before. It is now failing constantly. I either get:
• An exception
• A 500 Response
You can see both in the screenshots attachedNick Rodriguez
11/14/2025, 4:09 PMSebastião Assunção
11/14/2025, 4:25 PMTal Aharoni
11/16/2025, 1:25 PMSebastião Assunção
11/17/2025, 10:29 AMSebastião Assunção
11/17/2025, 10:32 AMInvalid refresh token instead of No such refresh token
Knowing that the user is not actively revoking the access on the provider side, does this make you believe the error is on the provider side itself "loosing" the connections?Tal Aharoni
11/17/2025, 10:57 AMSebastião Assunção
11/17/2025, 11:51 AM404 error on Descope also get an error in the console. The refresh token is in fact not found on the provider's side which would imply either:
• Provider error in somehow "forgetting" the refresh token
• Descope error in not storing the tokens correctly (seems weird to have started an error like this "out of nowhere")
• My user's manually revoking on the provider's side (which I know to not be True, but must be considered)
Regarding the notion-mcp outbound app, it is implemented using DCR with the token endpoint being https://mcp.notion.com/token to which I cannot find the correct documentation to test it's refresh token endpointSebastião Assunção
11/17/2025, 12:08 PMRefres Error entries. This is my own connection so I am 100% sure I did not touch it over the weekend and I know for a fact it was working on Friday.
I used that access token to connect to Supabase's MCP and got 401 Unauthorized. I tried refreshing the token via the dashboard by clicking on Refresh Access Token but nothing happened: no feedback, no error, no refresh: the same token was there.
I deleted the connection and went through the entire flow again:
1. Starting on my app, made a call to https://api.descope.com/v1/outbound/oauth/connect
2. On my app, went through the OAuth flow as normal
3. New token record appears (associated with the same User as before (confirming it is my account)
4. Now the token works!
Something happened over the weekend without me touching anything on the provider's side. I did not even touch the computed between Friday and todayTal Aharoni
11/17/2025, 12:18 PM404 error, you can get the refresh token from Descope and try refreshing it manually with the provider's /token endpoint do make sure it's something in the provider side.
2. regarding MCP with dynamic registration (DCR) the providers mostly use different endpoints and have different constrains. also the client is non-confidential and in many cases refresh are not supported or requires additional actions.
3. for the refresh that didn't do anything and didn't raise error, do you have cf-ray of the request or specific time and project ID so i can check it deeper?Sebastião Assunção
11/17/2025, 12:26 PM/token endpoint. My issue is that I do not have the slightest hint of why the refresh token stopped being valid when I know that on Friday it was working and on Monday it is not without any actions performed on my side. It seems it would either be a provider error or somehow the tokens not being correctly managed by Descope over time. Considering I've seen this happen to Notion and Supabase outbound apps in recent times, it points to some defect in the Descope <-> Provider connection
Regarding (2) -> Yes, DCR means different endpoints. I'm not being able to find the Notion MCP documentation on DCR to be able to test any refresh token directly so I cannot provide much more info on this topic
Regarding (3) -> I am sorry, I did not keep the cf-ray ID and I have since (as mentioned) deleted the connection and created a new one that is working correctly. It seems like creating fresh connections always fixes the issue (until the refresh inevitably fails). I will be sure to keep cf-ray IDs going forward to facilitate your side of things 🙏Tal Aharoni
11/17/2025, 12:41 PMSebastião Assunção
11/17/2025, 2:28 PMSebastião Assunção
11/17/2025, 2:32 PMU2yaXD9LWDZCdd42Q0AzBpKMQ8VE) that is not able is in this state in the Supabase app.
This happened over the weekend without ANY action on the user's side. How can I handle this on the application side?Sebastião Assunção
11/17/2025, 2:33 PMTal Aharoni
11/17/2025, 2:52 PMSebastião Assunção
11/17/2025, 2:52 PMSebastião Assunção
11/17/2025, 2:53 PMTal Aharoni
11/17/2025, 2:53 PMSebastião Assunção
11/17/2025, 2:56 PMU2yaXD9LWDZCdd42Q0AzBpKMQ8VE is my co-worker, I can perform actions on it. I have just manually deleted the connection on Descope's dashboard and re-created it from our App's side so now it is activeSebastião Assunção
11/21/2025, 4:16 PMSebastião Assunção
11/21/2025, 4:24 PMNotion MCP outbound app, it fails with [E151103] Failed to refresh OAuth application token: Failed to refresh OAuth app token [error: oauth2: "invalid_grant" "Invalid refresh token"]
CF-Ray of an example: 9a2189961885c156-LISTal Aharoni
11/23/2025, 9:03 AMSebastião Assunção
11/23/2025, 10:44 AMTal Aharoni
11/23/2025, 10:58 AMrefresh_token rotation. (you can see that after performing token refresh the refresh_token changes).
It can happen to every provider that performs refresh rotation (it doesn't happen all the time, but if the token got corrupted it will fail every time until connecting again)Sebastião Assunção
11/23/2025, 11:04 AMforceRefresh as per recommended aboveTal Aharoni
11/23/2025, 11:05 AMforce_refreshTal Aharoni
11/23/2025, 8:28 PMSebastião Assunção
11/23/2025, 8:31 PMTal Aharoni
11/23/2025, 8:42 PMrefresh_token instead of the new one when the provider's refresh operation is also rotating the refresh_token with a new one.
The main problem in that case is that the old refresh_token is not usable anymore by the provider and it will never get fixed until connecting the user again and getting new access_token and refresh_tokenSebastião Assunção
12/10/2025, 11:39 AMSebastião Assunção
12/10/2025, 11:40 AM9abc76bcfcabe3d1-LISTal Aharoni
12/10/2025, 12:25 PMNovember 13th and probably got corrupted before the fix was deployed at November 23th
As i wrote above, the fix is relevant only for new tokens that didn't get corrupted yet.
I suggest to delete those tokens and re-connect the users again to get new token.Sebastião Assunção
12/10/2025, 3:30 PM9abdc7523e71785f-LISTal Aharoni
12/10/2025, 3:34 PMNovember 13thSebastião Assunção
12/10/2025, 3:37 PMLast Refresh Error and refreshed them all exactly now.
I'll keep monitoring and see if any of them yield the same error in the future 🙏Tal Aharoni
12/10/2025, 3:39 PMSebastião Assunção
12/11/2025, 10:40 AM9ac45a6e7cf5e3d1-LISTal Aharoni
12/11/2025, 12:11 PMforce_refresh=true and with_refresh_token=true , any special reason for that?
Descope is refreshing automatically when needed. when forcing to refresh it increases the time it takes to get each token.Sebastião Assunção
12/11/2025, 12:12 PMTal Aharoni
12/11/2025, 12:13 PMrefresh_token in your services it also recommended not to ask with_refresh_token to avoid transferring sensitive data without needTal Aharoni
12/11/2025, 12:16 PMSebastião Assunção
12/11/2025, 12:29 PMTal Aharoni
12/11/2025, 12:53 PMSebastião Assunção
12/11/2025, 1:17 PMSebastião Assunção
12/15/2025, 1:17 PMTal Aharoni
12/15/2025, 7:52 PMforce_refresh param.
In any case we will if we can add additional protections also for such issues.
Did you implement the suggested changes above? it should significantly reduce and probably eliminate the chances for it to happen.Sebastião Assunção
12/16/2025, 9:54 AMSebastião Assunção
12/22/2025, 4:18 PM9b20ed6f5fec4898-LISSebastião Assunção
12/23/2025, 2:50 PM9b28abee7852055d-LISTal Aharoni
12/23/2025, 9:37 PMSebastião Assunção
12/24/2025, 10:15 AMTal Aharoni
12/24/2025, 11:10 AM-Uninstalling the app from the HubSpot portal
-Manually revoking access in account settings
-Admin removing the app from the organization
In this case we can't know from the caller side what is the real reason.
Does it happen to specific users? all users? are you the owner of that OAuth app?Tal Aharoni
12/24/2025, 11:16 AMTal Aharoni
12/24/2025, 11:25 AMSebastião Assunção
12/29/2025, 11:44 AMDoes it happen to specific users? all users?No, it seems that once it fails for one, it starts failing more frequently for others Here are CF-Rays from attempts to refresh tokens from 4 different users. Some of which (as you can see from the screenshot) have access token expiration dates as late as today (Dec 29th)
9b590654fb9b21da-LIS
9b5906b6ca2721da-LIS
9b5906ebb96021da-LIS
9b59071eedd721da-LIS
Are you the owner of that OAuth app?Yes, I am and we have changed nothing ever since it was created Regarding our inefficiencies, I'll look into our BE flows and evaluate how we can reduce the number of requests though I fail to see how that could impact the token refresh errors Thank you bey much for your help
Sebastião Assunção
12/29/2025, 4:23 PMU333j66Ag7xIVrTGR77zajf69RUC
I then tried almost immediately after to refresh the token from the dashboard (manually) and got a 400. CF-Ray for that request is 9b5a9f4ad9bac534-LIS
This token was obtained correctly less than 5 minutes before with the connection being successful...Tal Aharoni
12/29/2025, 4:51 PMTal Aharoni
12/30/2025, 10:33 AM2c62c1bf-b8c6-439f-b3a1-530e2daedb9c and maybe they can shed some light on why this refresh token is invalid.
Also, do you still see issues in other providers (other than hubspot)?Sebastião Assunção
12/30/2025, 10:40 AMnotion-mcp outbound app quite a few times. Here are 2 CF-RAYs from refresh requests of tokens that have Access Token Expiration on December 23rd:
9b60e94328d9c640-LIS
9b60e98e7ef6c640-LISTal Aharoni
12/30/2025, 10:54 AM9b5a9f4ad9bac534 .
I still see concurrent requests for the same user. Is it something you are planning to handle?Tal Aharoni
12/30/2025, 10:59 AMSebastião Assunção
12/30/2025, 11:00 AM