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

RP ID should be optional #165

Closed
netanel-utila opened this issue Sep 28, 2023 · 7 comments · Fixed by #234 · May be fixed by #166
Closed

RP ID should be optional #165

netanel-utila opened this issue Sep 28, 2023 · 7 comments · Fixed by #234 · May be fixed by #166
Labels
spec/level/1 Webauthn Specification Level 1 Related status/in-progress In Progress type/feature-request Feature Requests

Comments

@netanel-utila
Copy link

Version

0.8.4

Description

Hi,

It seems like not passing RP ID is invalid, but it should be valid. In case we don't set the RP ID in the options, it will use the current domain. This will also make it usable in localhost, for example.

By default, the RP ID for a WebAuthn operation is set to the caller’s origin's effective domain.

Reproduction

Try to not pass RP ID

Expectations

No response

Documentation

No response

@netanel-utila netanel-utila added status/needs-triage Issues that need to be triaged. type/potential-bug Potential Bugs labels Sep 28, 2023
@james-d-elliott
Copy link
Member

james-d-elliott commented Oct 1, 2023

We can definitely make this change since it's supported in the spec. I suspect it may not have been prior to level 1 (or was just missed when originally implemented) and it was definitely missed when I took over maintenance of the library.

@james-d-elliott
Copy link
Member

I've linked a fix to this. Would you mind trying it and see if it works? Reading the WDL it should be omitted I believe when this is intended.

@netanel-utila
Copy link
Author

Thanks for the quick response. We'll try it, and let you know. We suspect that there are more places need to be changed.

@james-d-elliott
Copy link
Member

james-d-elliott commented Oct 1, 2023

Yeah this is the exact reason I wanted it checked. I think this will be mostly sufficient but there may be a validation on the response which needs changing specifically this (see step 13) and this (see step 15). If so I suspect that either it MUST be in the config or it MUST be provided via a functional option.

@james-d-elliott james-d-elliott added type/feature-request Feature Requests status/in-progress In Progress spec/level/1 Webauthn Specification Level 1 Related and removed type/potential-bug Potential Bugs status/needs-triage Issues that need to be triaged. labels Oct 1, 2023
@netanel-utila
Copy link
Author

netanel-utila commented Oct 9, 2023

Hi, it also fails here:

return ErrVerification.WithInfo(fmt.Sprintf("RP Hash mismatch. Expected %x and Received %x", a.RPIDHash, rpIdHash))

@james-d-elliott
Copy link
Member

Yeah that's what I was expecting above. So question is where do you want to supply the RP-ID? We need to supply it to validate that portion there. It could be at config time or at the time of the flow with a functional option.

@jacob-utila
Copy link

I think it should be supported at the time of the flow, or maybe allow any RPID there if the RPID is empty (there is also the RPOrigins config that plays a part here).

james-d-elliott added a commit that referenced this issue Apr 29, 2024
This allows the Relying Party ID and Name to be configured at runtime rather than at configuration time.

Closes #165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec/level/1 Webauthn Specification Level 1 Related status/in-progress In Progress type/feature-request Feature Requests
Projects
None yet
3 participants