Implement session token refresh #71

Open
opened 2026-03-03 15:18:21 -08:00 by fable · 0 comments
Contributor

After a successful ATProto OAuth login, we discard the ATProto tokens and rely exclusively on the microclimate JWT for authentication. That JWT expires after 24 hours, so the client needs a way to renew it without repeating the full browser-based OAuth flow.

Add a RefreshSession RPC to AuthService that:

  • Accepts the current (possibly-expired) microclimate JWT
  • Verifies it was validly issued by this server (signature check, ignoring expiry)
  • Looks up the corresponding OAuthSession in the auth store by DID
  • Issues a fresh JWT with a new 24-hour expiry

The client should call this proactively before expiry (e.g. on app resume / reconnect).

Related to #9.

After a successful ATProto OAuth login, we discard the ATProto tokens and rely exclusively on the microclimate JWT for authentication. That JWT expires after 24 hours, so the client needs a way to renew it without repeating the full browser-based OAuth flow. Add a `RefreshSession` RPC to `AuthService` that: - Accepts the current (possibly-expired) microclimate JWT - Verifies it was validly issued by this server (signature check, ignoring expiry) - Looks up the corresponding `OAuthSession` in the auth store by DID - Issues a fresh JWT with a new 24-hour expiry The client should call this proactively before expiry (e.g. on app resume / reconnect). Related to #9.
puregarlic added this to the Ludwig (MVP) milestone 2026-03-03 15:25:51 -08:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
puregarlic/microclimate#71
No description provided.