authlib icon indicating copy to clipboard operation
authlib copied to clipboard

flask `DeviceAuthorizationEndpoint` ignores provided `client_id` when calling `save_device_credential`.

Open spenhand opened this issue 4 months ago • 1 comments

Describe the bug

flask DeviceAuthorizationEndpoint ignores provided client_id when calling save_device_credential.

Error Stacks

No errors. The bug incorrectly passes None in as the client_id, leading to potentially incorrect credentials saved.

To Reproduce

minimal test case test_patch.txt

Expected behavior

I would expect the client_id to be present and match that of the request.

Environment:

Not sure exactly how far back this goes, but my repro is on main and it seems like it's been around for a while.

Additional context

The issue happens because we never have client_id in the payload after parsing the basic auth header. So this call fails:

        self.save_device_credential(
            request.payload.client_id, request.payload.scope, data
        )

spenhand avatar Aug 21 '25 20:08 spenhand

we just ran into this one too.. @lepture any chance you can take a peek? 🙏

night avatar Sep 02 '25 16:09 night