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

Device Authorization Flow not working with offline_access scope / refresh token #11399

Open
Exotrom opened this issue Sep 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Exotrom
Copy link

Exotrom commented Sep 16, 2024

Describe the bug
When using the Device Authorization Flow, including the offline_access scope won't include a refresh_token in the token response.

To Reproduce
Steps to reproduce the behavior:

  1. Init a device authorization flow while requesting the offline_access scope
  2. Confirm the device code
  3. Retrieve the token

Expected behavior
Token response contains a refresh_token

Version and Deployment (please complete the following information):

  • authentik version: 2024.8.1
  • Deployment: docker-compose

Additional context
I think, there is an error in the https://github.com/goauthentik/authentik/blame/main/authentik/providers/oauth2/views/token.py#L714
Current implementation requires the token request to contain the offline_access scope, however, I think it must be included in the initial device authorization request.

if SCOPE_OFFLINE_ACCESS in self.params.scope

vs.

if SCOPE_OFFLINE_ACCESS in self.params.device_code.scope
@Exotrom Exotrom added the bug Something isn't working label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant