Skip to content

[Core feature] Device authorization grant (RFC 8628) in flyteadmin's built-in authorization server #8086

Description

@santhosh-shanmugham

Motivation: Why do you think this is important?

flytectl and flytekit both implement the OAuth 2.0 device authorization grant (authType: DeviceFlow, flyteidl #313). They discover the device endpoint from flyteadmin's OAuth metadata (GetOAuth2Metadata, /.well-known/oauth-authorization-server). flyteadmin's built-in authorization server (authServerType: Self) never advertises one and does not implement the grant, so on a deployment that uses the built-in server the device flow cannot start. The only way to log in from a host without a browser is a browser-less workaround, an external authorization server, or a patched client.

This comes up regularly: How do I setup device code authentication, #5084, and the reason I opened #8080 and #8081. Moving to an external authorization server is a large change when the deployment only needs headless CLI login, and it is not an option when the IdP has no client_credentials grant for the in-cluster components (Dex, for example).

Goal: What should the final outcome look like, ideally?

With authServerType: Self:

  • the metadata response includes device_authorization_endpoint
  • flyteadmin implements RFC 8628: a device authorization endpoint that issues device and user codes, a verification page that reuses the existing /login OIDC flow and records the approval, and the urn:ietf:params:oauth:grant-type:device_code grant at the token endpoint
  • the default flytectl public client allows that grant type

Stock flytectl and flytekit then work with authType: DeviceFlow and no client change, and they receive flyteadmin's own access and refresh tokens like the PKCE flow does today.

Describe alternatives you've considered

  • Let clients run the device flow against the OIDC provider and send ID tokens #8080: the Go client runs the device flow against the OIDC provider directly and sends the result as IDToken. Fixes flytectl only; flytekit would need the same change in Python.
  • Accept OIDC ID tokens presented with the Bearer scheme #8081: flyteadmin accepts an OIDC ID token presented as Bearer. Lets any client that can obtain an ID token out of band log in, but each client still needs its own way to run the device flow.
  • A proxy in front of flyteadmin that rewrites the metadata to point at the OIDC provider's device endpoint and rewrites Bearer to IDToken for provider-issued tokens. Works today with stock clients, but every deployment has to build and run it.
  • authServerType: External. Heavy, and it moves client_credentials for propeller and friends to the external IdP, which some IdPs do not support.

Propose: Link/Inline OR Additional context

flyteadmin pins github.com/ory/fosite v0.42.2. fosite added RFC 8628 in v0.47.0 (handler/rfc8628, compose.RFC8628DeviceFactory, compose.RFC8628DeviceAuthorizationTokenFactory), so the grant itself is a fosite upgrade plus two factories in auth/authzserver/initialize.go. The pieces that need design:

  • storage for device and user codes, since flyteadmin's authorize codes are stateless encrypted JWTs and the device grant needs to look a user code up
  • the verification page (/oauth2/device) that runs the existing OIDC login and marks the code approved
  • DeviceAuthorizationEndpoint in the self server's metadata provider

I am happy to contribute this if the approach is acceptable. #8080 and #8081 stand as the smaller alternatives.

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes

Activity

  1. runllm commented on Sep 28, 2026

    @runllm

    It could be possible that Flyte's built-in authorization server (authServerType: Self) currently does not support the OAuth 2.0 device authorization grant (RFC 8628), as the device authorization endpoint is not advertised in its OAuth metadata and the grant is not implemented. This means device flow authentication cannot be used with the built-in server, and users must rely on external IdPs or workarounds for headless CLI login. The request is to add device flow support directly to the built-in server, leveraging recent RFC 8628 support in the underlying fosite library, and to expose the necessary endpoints and grant types so that stock clients (flytectl, flytekit) work out of the box with authType: DeviceFlow and no client changes.

    Though I'm not entirely certain, it might be that the data sources do not mention any current support for device flow in the built-in server, nor do they describe the implementation of a device authorization endpoint or the required metadata changes. The alternatives and technical details you propose (fosite upgrade, endpoint exposure, code storage, verification page) are not explicitly covered in the available documentation or code references. Would you like a step-by-step breakdown of how this could be implemented, or a summary of the relevant configuration and current limitations?

    Sources:


    This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

    Mention @Herald to ask follow-up questions. See runllm.com for more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions