Skip to content
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

Issue: offline_access Scope Included in Tokens by Default #613

Closed
vrbanecd opened this issue Feb 7, 2025 · 2 comments
Closed

Issue: offline_access Scope Included in Tokens by Default #613

vrbanecd opened this issue Feb 7, 2025 · 2 comments

Comments

@vrbanecd
Copy link

vrbanecd commented Feb 7, 2025

Description

When manually creating an OIDC account using oidc-gen -m <account>, I specify all the desired scopes but intentionally omit offline_access. However, after generating the account, requesting a token with oidc-token <account> still includes the offline_access scope in the token.

If I try to remove offline_access from my client configuration to prevent this, oidc-gen throws an error and doesn't allow me to create the account.

Question

Is there a way to configure an OIDC account to generate tokens without including offline_access by default?

I’m aware that I can manually specify the desired scopes each time I request a token, but this is cumbersome. Ideally, I’d like to configure the account so that tokens exclude offline_access by default.

@zachmann
Copy link
Member

zachmann commented Feb 7, 2025

In oidc offline_access is used to request a refresh token from the OP (in addition to the access token). This refresh token is stored in the account config and is required for the agent to be able to obtain additional access tokens.

Therefore, the offline_access scope is always required and automatically added.

oidc-gen has a --only-at option where only a (single) access token is obtained; this mode does not use offline_access, however, it also does not create an account configuration.

@vrbanecd
Copy link
Author

vrbanecd commented Feb 7, 2025

OK, I understand. But can't oidc-agent request offline-access scope from the client, but not automatically include it in the access-tokens it generates when the user doesn't specifically indicate it in his list of scopes?

zachmann added a commit that referenced this issue Mar 11, 2025
do not request `offline_access` in a token refresh request; fix #613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants