Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

feat: enable FIDO U2F MFA #201

Merged
merged 1 commit into from
Sep 4, 2019
Merged

Conversation

aadityasondhi
Copy link
Contributor

adds support for U2F FIDO devices such as yubikey. The U2F device must
already be registered with Okta and be plugged in and available for use.

retry if open fails, there are issues with the low level hid_open call
that we rely on in hidapi.

These are the libraries we depend on:
https://github.com/marshallbrekka/go-u2fhost/blob/master/hid/wrapper.go
https://github.com/marshallbrekka/go.hid
https://github.com/signal11/hidapi

lib/okta.go Outdated
PassCode: mfaCode,
})

// only add the mfaCode to the payload if it's non-empty
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this equivalent to the old code? PassCode is a string so its zero value should be "", same as mfaCode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In terms of functionality, it is the same. Just wanted to make it explicit how PassCode was being set.

Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the sentiment, but I don't think it makes things appreciably clearer. In fact, now the err-check below is actually checking something else in the case that mfaCode == "". So I'd say change it back

Also, what's with https://github.com/segmentio/aws-okta/pull/201/files#diff-5057c2ca588b57c0ada94b258bba5624R301? Seems superfluous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, I agree. Will return this block to its original implementation.

Copy link
Contributor

@nickatsegment nickatsegment left a comment

Choose a reason for hiding this comment

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

Awesome. Had one small question, but happy to merge as is.

@aadityasondhi
Copy link
Contributor Author

Made the changes, feel free to merge whenever.

lib/okta.go Outdated Show resolved Hide resolved
adds support for U2F FIDO devices such as yubikey. The U2F device must
already be registered with Okta and be plugged in and available for use.

retry if open fails, there are issues with the low level `hid_open` call
that we rely on in `hidapi`.

These are the libraries we depend on:
https://github.com/marshallbrekka/go-u2fhost/blob/master/hid/wrapper.go
https://github.com/marshallbrekka/go.hid
https://github.com/signal11/hidapi
Copy link
Contributor

@nickatsegment nickatsegment left a comment

Choose a reason for hiding this comment

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

Awesome, let's merge!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants