Skip to content

Ask user to otp at webauthn verification url#6179

Merged
simi merged 3 commits intoruby:webauthn-clifrom
Shopify:webauthn-request-link
Jan 25, 2023
Merged

Ask user to otp at webauthn verification url#6179
simi merged 3 commits intoruby:webauthn-clifrom
Shopify:webauthn-request-link

Conversation

@aellispierce
Copy link
Contributor

NOTE: This is being merged into a feature branch, not main, so that work may continue to be developed in small pieces as we built out webauthn for the CLI

What was the end-user or developer problem that led to this PR?

Users with MFA enabled would like to use security devices (yubikey, touch id, etc) for logging in with WebAuthn on the CLI

What is your fix for the problem, implemented in this PR?

  • For users with MFA enabled, we request a webauthn verification url from rubygems.org on sensitive actions (sign in, yank, push, add/remove owners).
  • If the user does not have a webauthn device enabled, there is no change in the user interaction. The api would respond with a 403 and we would continue to ask for a regular OTP code as normal.
  • For users that do have webauthn enabled, the api would respond with the webauthn verification url. Users would then verify at that link, receive an OTP code, and then input that here.
  • This is just the first step, receiving the link and displaying it to users, the actual verification will happen in follow up PRs on the client and CLI.

.org feature branch: rubygems/rubygems.org#3298
Matching .org work: rubygems/rubygems.org#3305

Make sure the following tasks are checked

Copy link
Contributor

@jchestershopify jchestershopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small questions. No blockers though.

@aellispierce
Copy link
Contributor Author

cc @simi for review

@simi simi self-requested a review December 23, 2022 15:30
Copy link
Contributor

@jenshenny jenshenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just have a suggestion on the OTP prompt phrasing here: #6179 (comment)

request.add_field "Authorization", api_key
end
end
response.is_a?(Net::HTTPSuccess) ? response.body : nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For hosts that do not have webauthn / "api/v1/webauthn_verification" implemented yet, I'm guessing that there's not going to be a change in behaviour since this method would return nil.

@jchestershopify
Copy link
Contributor

@simi any thoughts so far?

Copy link
Contributor

@indirect indirect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants