Hi, I'm having issues with `<https://api.descope.c...
# ask-a-descoper
s
Hi, I'm having issues with
https://api.descope.com/v1/auth/refresh
endpoint. I'm using ruby SDK and when I'm calling
.refresh_session
it returns
refreshSessionToken
but not
sessionToken
. I checked debug logs and see that endpoint returns empty refresh and session tokens, SDK falling back to refresh token that I provided and return me this as a result. I can't understand from this logs why it behaves like this. I have 2 projects (local and staging), both almost the same, created via terraform. For local it works fine, for staging it's not. Could someone help me debug it?
r
could be related to the session management settings. @Rahul Rijhwani please assist here further
r
Yes I am checking this.
Hi @Serhii Can you check Project-level settings: Configure in the Descope console under Settings > Project > Session Management. You can set: • Refresh Token Timeout • Session Token Timeout (must be at least 3 minutes and can't exceed Refresh Token Timeout) • Session Inactivity detection and timeout Tenant-level settings: Each tenant can inherit project settings or have custom configurations. Use the API to update tenant session settings:
Copy code
POST /v1/mgmt/tenant/settings
With parameters like: •
refreshTokenExpiration
and
refreshTokenExpirationUnit
•
sessionTokenExpiration
and
sessionTokenExpirationUnit
•
enableInactivity
,
inactivityTime
, and
inactivityTimeUnit
For your staging vs local issue: Compare these settings between your two projects, as differences in token expiration or storage method (cookies vs response body) could explain why one works and the other doesn't.
s
@Rahul Rijhwani staging
local
r
Check refresh token setting in both screenshot.
s
Not sure that I follow what wrong with it? I can't use cookies locally because it's not working with setting cookies to localhost (https://docs.descope.com/unit-testing/local-testing-tokens) Also I don't have problems to setting them I have a valid refresh token (not expired) and the problem when I trying to use it to refresh I'm not getting new session token back
r
@Reuven Zabirov or @Nick Rodriguez can you check here I have checked with @Serhii personally so in project have diff token response method in local and stage so getting issue I guess. can you just check
s
Hi @Reuven Zabirov @Nick Rodriguez I can share more details in personal messages. Who will be able to assist?
thanks @Rahul Rijhwani!
n
Hey @Serhii You can send me a message and I can assist you there.
r
Hey @Serhii pls share the details with me.