-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
GitLab OAuth access tokens expire after 2 hours by default (some configurations may allow up to 1 day). Currently, nix-auth does not capture or use the refresh_token that GitLab returns in the OAuth response, so users need to re-authenticate frequently.
Current behavior
The gitLabTokenResponse struct only captures:
access_tokentoken_typeexpires_inscope
GitLab actually returns additional fields including refresh_token which is ignored.
Proposed solution
Implement refresh token support:
- Capture
refresh_tokenfrom GitLab's token response - Store refresh tokens in a metadata file (e.g.,
~/.config/nix/nix-auth-metadata.json) sinceaccess-tokens.confonly supports simplehost=tokenformat - Add
nix-auth refreshcommand to manually refresh tokens before they expire - Auto-refresh on
nix-auth statuswhen tokens are near expiration (optional)
References
- GitLab OAuth 2.0 API docs - "Access tokens expire after two hours. Integrations that use access tokens must generate new ones using the
refresh_tokenattribute." - GitLab OAuth provider docs
Related
Reported as follow-up to #7
Metadata
Metadata
Assignees
Labels
No labels