Device Authorization with Okta using zitadel/oidc
Hello! I'm attempting to use
zitadel/oidc
for device authorization against Okta, but I'm getting back this error from DeviceAuthorization
:
This appears to be due to the client_assertion
fields being included in the request even when empty. If I modify the fields in https://github.com/zitadel/oidc/blob/main/pkg/oidc/token_request.go#L243-L244 to include the omitempty
attribute, device authorization against Okta works.
Is this a known issue, or is there a known workaround? I'm happy to create an issue and a PR if that helps.7 Replies
Hey @Jon @ Posit good day.
Can you please share your curl request here?.
Thanks
Here's a
curl
example:
Starting with an Okta test application:
This is what works:
But if you add the client assertion fields like the zitadel/oidc
library does, it fails:
I wonder - are the client_assertion
and client_assertion_type
fields even needed in this struct? It looks like it's used only for device auth and the RFC https://www.rfc-editor.org/rfc/rfc8628 doesn't even mention these fields.
On the other hand, this also feels like an Okta bug, but I don't see harm in supressing the fields if they're empty.hey @Jon @ Posit thnaks for raising this, can you pls modify the struct to include the
omitempty
tag for these fields and see it it helps you to proceed?.
this is a workaround if it helps, I will look for more information on it meanwhileYes, I've already tested after compiling with the
omitempty
attribute. It fixes the problem and device auth with Okta works.
I've already forked the repository, so let me know if you'd like me to submit a PR. I'm happy to do that if it helps.
And thanks for your help!hi @Jon @ Posit yes please, make sure to be very descriptive in the issue so it can help our engineers to review it better.
Looking forward to it 🙂
I've created a PR, which I linked to an issue (bug report) I also created. https://github.com/zitadel/oidc/pull/745 and https://github.com/zitadel/oidc/issues/744.
thanks @Jon @ Posit