-
Notifications
You must be signed in to change notification settings - Fork 981
docs: add more specific steps and information about oidc refresh tokens #18336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
56158b8
add offline_access scope
EdwardAngert 566fe99
md fixes and lots of offline_access notes
EdwardAngert 2f07f99
Merge branch 'main' into 18307-refresh-tokens
EdwardAngert e69afa5
move external auth to own directory
EdwardAngert 1030bd6
Merge branch 'main' into 18307-refresh-tokens
EdwardAngert 7a92bde
relative link
EdwardAngert 290b8ab
new refresh tokens doc
EdwardAngert 2a816e6
Merge branch 'main' into 18307-refresh-tokens
EdwardAngert a92ad17
put the comma back
EdwardAngert cc0e46f
move refresh tokens to oidc
EdwardAngert d951736
add azure and pf, reorg doc
EdwardAngert 0438aad
token config troubleshooting clarify
EdwardAngert bbbd751
md lint ignore heading levels
EdwardAngert 2618ffa
remove from idp-sync
EdwardAngert 4dedaf1
add configure section to oidc-auth
EdwardAngert 5d863cc
Merge branch 'main' into 18307-refresh-tokens
EdwardAngert 2ef836d
relative links
EdwardAngert f737eb5
remove note because it doesn't like being nested
EdwardAngert 6ad5822
Merge branch 'main' into 18307-refresh-tokens
EdwardAngert 1984341
separate general/google in troubleshooting
EdwardAngert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
new refresh tokens doc
- Loading branch information
commit 290b8ab136f7db33242926d3559a93c272bca091
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Configure OIDC refresh tokens | ||
|
||
<div class="tabs"> | ||
|
||
|
||
To ensure Coder receives a refresh token when users authenticate with Google | ||
directly, set the `prompt` to `consent` in the auth URL parameters. Without | ||
this, users will be logged out after 1 hour. | ||
|
||
In your Coder configuration: | ||
|
||
```shell | ||
CODER_OIDC_AUTH_URL_PARAMS='{"access_type": "offline", "prompt": "consent"}' | ||
``` | ||
|
||
## Keycloak | ||
|
||
The `access_type` parameter has two possible values: `online` and `offline`. | ||
By default, the value is set to `offline`. | ||
|
||
This means that when a user authenticates using OIDC, the application requests | ||
offline access to the user's resources, including the ability to refresh access | ||
tokens without requiring the user to reauthenticate. | ||
|
||
To enable the `offline_access` scope which allows for the refresh token | ||
functionality, you need to add it to the list of requested scopes during the | ||
authentication flow. | ||
Including the `offline_access` scope in the requested scopes ensures that the | ||
user is granted the necessary permissions to obtain refresh tokens. | ||
|
||
By combining the `{"access_type":"offline"}` parameter in the OIDC Auth URL with | ||
the `offline_access` scope, you can achieve the desired behavior of obtaining | ||
refresh tokens for offline access to the user's resources. | ||
|
||
</div> | ||
|
||
## Troubleshooting OIDC refresh tokens | ||
|
||
### Users Are Logged Out Every Hour | ||
|
||
**Symptoms**: Users experience session timeouts approximately every hour and must re-authenticate | ||
**Cause**: Missing `offline_access` scope in `CODER_OIDC_SCOPES` | ||
**Solution**: | ||
|
||
1. Add `offline_access` to your `CODER_OIDC_SCOPES` configuration | ||
1. Restart your Coder deployment | ||
1. All existing users must logout and login once to receive refresh tokens | ||
|
||
### Refresh Tokens Not Working After Configuration Change | ||
|
||
**Symptoms**: Hourly timeouts, even after adding `offline_access` | ||
**Cause**: Existing user sessions don't have refresh tokens stored | ||
**Solution**: Users must logout and login again to get refresh tokens stored in the database | ||
|
||
### Verify Refresh Token Configuration | ||
|
||
To confirm that refresh tokens are working correctly: | ||
|
||
1. Check that `offline_access` is included in your `CODER_OIDC_SCOPES` | ||
1. Verify users can stay logged in beyond Okta's access token lifetime (typically one hour) | ||
1. Monitor Coder logs for any OIDC refresh errors during token renewal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.