Make client-credentials token refresh buffer and jitter configurable
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java
- Domain
- authentication, authorization
Research direction
Start by reading src/main/java/dev/openfga/sdk/api/auth/AccessToken.java and src/main/java/dev/openfga/sdk/constants/FgaConstants.java, as referenced in the issue, to locate the hardcoded expiry buffer and jitter. Trace how client-credentials tokens are cached and refreshed, then make both values configurable and verify that five-minute tokens can be reused with a smaller buffer and jitter.
Written by the indexing model from the issue text.
Description
Checklist
- I agree to the terms within the OpenFGA Code of Conduct.
Describe the problem you'd like to have solved
In SDK 0.9.11, the client-credentials token expiry buffer is hardcoded to 300 seconds, plus 0–299 seconds of jitter. With Keycloak issuing 300-second access tokens, a freshly cached token is immediately considered stale. Sequential API calls therefore request new tokens instead of reusing them.
Describe the ideal solution
Allow configuring the refresh buffer and jitter, for example a 30-second buffer with a small jitter for five-minute tokens.
Alternatives and current workarounds
Increasing the Keycloak client's token lifetime avoids the mismatch, but requires longer-lived tokens to accommodate the SDK.
References
- Dominant language
- Java
- Stars
- 54
- Forks
- 26
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openfga/java-sdk
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
enhancement needs-discussion
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in openfga/java-sdk
Similar issues
-
area/plugin
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kestra-io/plugin-kestra#190 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/rocketmq-dashboard#5064 ·