Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make required credentials creation options more explicit #155

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

bdewater
Copy link
Collaborator

@bdewater bdewater commented Apr 7, 2019

These fields are required by the spec, they have meaning in how and when they should be used: https://www.w3.org/TR/2019/PR-webauthn-20190117/#dictionary-pkcredentialentity

I think current the defaults are not helpful for users of the gem since they may be shown by the browser in the future. If this happens, the unchanged defaults may lead to authentication prompts like:

Scan fingerprint to authenticate as web-user for web-server

To not break backwards compatibility while making the need for explicit configuration more obvious, I've made the keyword arguments optional for now with a note to change this for version 2.0.

These fields are required by the spec, they have meaning in how and when they
should be used: https://www.w3.org/TR/2019/PR-webauthn-20190117/#dictionary-pkcredentialentity

I think current the defaults are not helpful for users of the gem since they may
be shown by the browser in the future. If this happens, the unchanged defaults
may lead to authentication prompts like:
> Scan fingerprint to authenticate as web-user for web-server

To not break backwards compatibility while making the need for explicit
configuration more obvious, I've made the keyword arguments optional for now
with a note to change this for version 2.0.
@bdewater bdewater force-pushed the explicit-cred-creation-opts branch from b59615a to 0444f22 Compare April 7, 2019 22:13
@grzuy
Copy link
Contributor

grzuy commented Apr 8, 2019

Good call.

I think it might be worth considering in the future making RP name and ID configs that can be set just once during boot. While still supporting the override in the #credential_creation_options method.

@grzuy grzuy merged commit ab343d1 into cedarcode:master Apr 8, 2019
TYPES = { create: "webauthn.create", get: "webauthn.get" }.freeze

def self.credential_creation_options
# TODO: make keyword arguments mandatory in next major version
def self.credential_creation_options(rp_name: "web-server", user_name: "web-user", display_name: "web-user", id: "1")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'll change id to user_id to avoid confusion with RP ID.

Copy link
Contributor

Choose a reason for hiding this comment

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

Changed in 18bb1d2

@bdewater bdewater deleted the explicit-cred-creation-opts branch April 8, 2019 02:20
@grzuy grzuy mentioned this pull request Apr 24, 2019
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.

None yet

2 participants