- Notifications
You must be signed in to change notification settings - Fork927
chore: implement device auth flow for fake idp#11707
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This stack of pull requests is managed by Graphite.Learn more about stacking. |
b72cea9
toda21464
Comparecoderd/coderdtest/oidctest/idp.go Outdated
_, _ = fmt.Fprint(rw, url.Values{ | ||
"device_code": {deviceCode}, | ||
"user_code": {flow.userInput}, | ||
"verification_uri": {verifyURL}, | ||
"expires_in": {strconv.Itoa(int(lifetime.Seconds()))}, | ||
"interval": {"3"}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should this use.Encode()
? Otherwise it could be printed asmap[device_code:[] ...]
or whatever the string representation ofurl.Values
is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Whoops, good catch
This reverts commitf3ac7d0.
* implement test using fake idp device flow* improve error handling around device code failure
f88117e
to9bc29db
Compare
Uh oh!
There was an error while loading.Please reload this page.
Device Flow faking
Device flow:https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
The fake IDP has been used to test all our oauth flows. I introduced a regression (fixed here#11706) because we were not checking the
Accept
header for the proper mime type. I could have just implemented that check, but I want to implement this for future testing.Will also implement better error handling to return a better error if this happens again.
Kooha-2024-01-19-11-33-33.mp4