-
Notifications
You must be signed in to change notification settings - Fork 27
Authentication using domain name #6
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
6d218db
e55062c
92aff84
60bdf70
aab50da
e0c9426
5921439
04f698d
6366b8a
c6e090c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # HIP-0003 : Authentication using Handshake name | ||
|
|
||
| ``` | ||
| Number: HIP-0003 | ||
| Title: Authentication using Handshake name | ||
| Type: Informational | ||
| Status: Draft | ||
| Authors: Fernando Falci <https://iamfernando/> | ||
| Created: 2020-10-25 | ||
| ``` | ||
|
|
||
| ## Abstract | ||
|
|
||
| This HIP describe how to authenticate a user using his/her Handshake name. | ||
|
|
||
| ## Motivation | ||
|
|
||
| Many websites need to identify the user and proof he/she owns a Handshake name. Many other websites simply need to identify users, which forces them to go into a process to pick a unique username that most of the time can't be consistent across different apps. By using Handshake names as username it allows both: proof ownership of the name and consistent username across unrelated apps. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Protocol | ||
|
|
||
| The basics of this protocol consist of a public and private ECDSA key. The domain exposes the public key via HTTPS request. | ||
| The Service that wants to authenticate the user should provide this user with a unique challenge. | ||
| The User signs the challenge using his/her private key and returns it to the Service, among the public key and the domain name. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
| The Service then validates if the challenge is correct and was correct signed. The Service also validates if the domain name indeed exposes that public key. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Provider | ||
|
|
||
| The above-mentioned flow requires an extra piece of software: a user-trusted provider. This provider knows/holds the user's private key. It can run on the client-side, as a browser extension or an installed app; or it can run remotely as a regular web service. | ||
|
Falci marked this conversation as resolved.
|
||
| This provider will respond to the request with the signed challenge sent by the Service. | ||
|
|
||
| To be a provider, the Provider needs to register and respond for the [custom protocol](https://html.spec.whatwg.org/#web+-scheme-prefix) `web+hns`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| This protocol will be used by the Service to send authentication challenges. | ||
|
|
||
| Assuming that the community will provide different solutions and implementation options, the User will choose one Provider and register it to respond to the custom protocol. | ||
|
|
||
| It is outside the context of this HIP to define how the Provider interacts with the User or how the public/private keys should be generated. | ||
|
|
||
| This also means that, once the User chooses a Provider and is onboarded, the User won't be able to switch to another provider without replacing its public key. In other words: the User cannot authenticate itself with any Provider, but only with the Provider he/she used to generate the public key. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Exposing the public key | ||
|
|
||
| The public key should be exposed via HTTPS request to `.well-known/authentication`. For the domain `example` the full URL should be `https://example/.well-known/authentication`. | ||
|
|
||
| This url should use a SSL certificate validate with [DANE](https://tools.ietf.org/html/rfc6698) or by a Certificate authority. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ### Authentication request | ||
|
|
||
| Any Service can create an authentication request. It's a basic `GET` request to `web+hns://authentication/?challenge=<CHALLENGE>&callback=<CALLBACK>`. | ||
|
|
||
| | Key | Type | Options | | ||
| | -------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | ||
| | web+hns:// | protocol | Fixed. | | ||
| | authentication | Reserved URL keyword | Fixed. | | ||
| | challenge | querystring | A 32-characters long string. Hex. | | ||
| | callback | querystring | An encoded callback URL. It will be (async) called by the provider with the challenge response. It must be a secure URL (HTTPS). | | ||
|
|
||
| ### Authentication response | ||
|
|
||
| It's a Provider's decision on how to identify and authenticate the user with the Provider. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| Once the provider identifies the User, it can sign the challenge using the User's private key and call the Service using the provided callback URL in a `GET` request. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| The following query string should be added to the callback URL: | ||
|
|
||
| | Key | Options | | ||
| | --------- | ------------------------------------------- | | ||
| | domain | The domain name that will identify the user | | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
| | challenge | The same challenge sent by the Service | | ||
| | signature | The signed challenge | | ||
|
|
||
| ### Handling a response | ||
|
|
||
| When the Service is called via its callback URL, it should do the following verifications: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| - Check if the domain exposes a public key. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
| - Check if the challenge is the same challenge from the request. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
| - Verify if the signature is valid (using the already retrieved public key). | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| The Service should reject the authentication request if any of the above fails. | ||
|
|
||
| Note: there's no point in adding the public key in the response from the Provider to the Service since it won't be trusted. | ||
|
|
||
| Once all verifications are complete, the Service can use the `domain` to identify the current user. | ||
|
Falci marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Consideration | ||
|
|
||
| This proposal does not force the domain name to be a TLD. Users could authenticate themselves with `support.example` for instance. | ||
|
|
||
| There's no need to be strict with a Handshake domain name. Users could authenticate themselves with `example.com` for instance. | ||
|
|
||
|
Falci marked this conversation as resolved.
Outdated
|
||
| ## Reference | ||
|
|
||
| [DANE](https://tools.ietf.org/html/rfc6698) | ||
Uh oh!
There was an error while loading. Please reload this page.