Update documentation for RFC 7033 WebFinger
This commit is contained in:
parent
3e7e649025
commit
80e4844654
1 changed files with 36 additions and 75 deletions
|
|
@ -2,88 +2,43 @@
|
||||||
title: WebFinger
|
title: WebFinger
|
||||||
---
|
---
|
||||||
|
|
||||||
diaspora\* uses an old draft of [WebFinger][webfinger-draft] to discover users from other pods.
|
diaspora\* uses [WebFinger][webfinger-rfc] to discover users from other pods.
|
||||||
|
|
||||||
{% include warning_box.html
|
|
||||||
title="Old WebFinger"
|
|
||||||
content="<p>diaspora* doesn't yet fully support the RFC 7033 WebFinger!</p>"
|
|
||||||
%}
|
|
||||||
|
|
||||||
## WebFinger endpoint discovery
|
|
||||||
|
|
||||||
To find the WebFinger endpoint, the requesting server must get the [host metadata][host-meta] information for the
|
|
||||||
domain of the searched diaspora\* ID.
|
|
||||||
|
|
||||||
### Request
|
|
||||||
|
|
||||||
Let's assume we are searching for `alice@example.org`, then we need the host metadata for `example.org`.
|
|
||||||
|
|
||||||
The request should first be tried with https, if this doesn't work, the requesting server should fallback to http.
|
|
||||||
|
|
||||||
If the server response indicates that the host-meta resource is located elsewhere (a 301, 302, or 307 response status
|
|
||||||
code), the requesting server should try to obtain the resource from the location provided in the response.
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
~~~
|
|
||||||
GET /.well-known/host-meta
|
|
||||||
Host: example.org
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
The host-meta document must be in the [XRD 1.0 document format][xrd] and should be served with the
|
|
||||||
`application/xrd+xml` media type.
|
|
||||||
|
|
||||||
#### Mandatory Link Relations
|
|
||||||
|
|
||||||
The Host Metadata response must contain the following link relations:
|
|
||||||
|
|
||||||
| Link Relation | Type | Description |
|
|
||||||
| ------------- | ------------ | ------------------------------------------------------------------------- |
|
|
||||||
| lrdd | url template | The template to the URL where the server provides the WebFinger endpoint. |
|
|
||||||
|
|
||||||
The Host Metadata response may contain other optional link relations.
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
|
|
||||||
~~~
|
|
||||||
Status: 200 OK
|
|
||||||
Content-Type: application/xrd+xml; charset=utf-8
|
|
||||||
~~~
|
|
||||||
~~~xml
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
|
||||||
<Link rel="lrdd" type="application/xrd+xml" template="https://example.org/.well-known/webfinger.xml?resource={uri}"/>
|
|
||||||
</XRD>
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## WebFinger
|
## WebFinger
|
||||||
|
|
||||||
### Request
|
### Request
|
||||||
|
|
||||||
|
~~~
|
||||||
|
GET /.well-known/webfinger
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Let's assume we are searching for `alice@example.org`, then we need to make a request to `example.org`.
|
||||||
|
|
||||||
|
The request should first be tried with https, if this doesn't work, the requesting server should fallback to http.
|
||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
The requesting server must replace the ``{uri}`` in the lrdd-template from the host-meta request with the diaspora\* ID
|
| Name | Description |
|
||||||
of the searched person.
|
| ---------- | ------------------------------------------------------------ |
|
||||||
|
| `resource` | The "acct" URI for the diaspora\* ID of the searched person. |
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
GET /.well-known/webfinger.xml?resource=acct:alice@example.org
|
GET /.well-known/webfinger?resource=acct:alice@example.org
|
||||||
Host: example.org
|
Host: example.org
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
The webfinger document must be in the [XRD 1.0 document format][xrd] and should be served with the
|
The WebFinger document must be in the [JSON Resource Descriptor (JRD) format][jrd] and should be served with the
|
||||||
`application/xrd+xml` media type.
|
`application/jrd+json` media type.
|
||||||
|
|
||||||
If the requested diaspora\* ID is unknown by the server, it must return a 404 status code.
|
If the requested diaspora\* ID is unknown by the server, it must return a 404 status code.
|
||||||
|
|
||||||
#### Subject
|
#### Subject
|
||||||
|
|
||||||
The ``Subject`` element should contain the webfinger address that was asked for. If it does not, then this webfinger
|
The `subject` element should contain the WebFinger address that was asked for. If it does not, then this WebFinger
|
||||||
profile must be ignored.
|
profile must be ignored.
|
||||||
|
|
||||||
#### Mandatory Link Relations
|
#### Mandatory Link Relations
|
||||||
|
|
@ -101,26 +56,32 @@ The WebFinger response may contain other optional link relations.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
Status: 200 OK
|
Status: 200 OK
|
||||||
Content-Type: application/xrd+xml; charset=utf-8
|
Content-Type: application/jrd+json; charset=utf-8
|
||||||
|
Access-Control-Allow-Origin: *
|
||||||
~~~
|
~~~
|
||||||
~~~xml
|
~~~json
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
{
|
||||||
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
|
"subject": "acct:alice@example.org",
|
||||||
<Subject>acct:alice@example.org</Subject>
|
"links": [
|
||||||
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="https://example.org/hcard/users/7dba7ca01d64013485eb3131731751e9"/>
|
{
|
||||||
<Link rel="http://joindiaspora.com/seed_location" type="text/html" href="https://example.org/"/>
|
"rel": "http://microformats.org/profile/hcard",
|
||||||
</XRD>
|
"type": "text/html",
|
||||||
|
"href": "https://example.org/hcard/users/7dba7ca01d64013485eb3131731751e9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rel": "http://joindiaspora.com/seed_location",
|
||||||
|
"type": "text/html",
|
||||||
|
"href": "https://example.org/"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
## Additional information and specifications
|
## Additional information and specifications
|
||||||
|
|
||||||
* [RFC 6415: Web Host Metadata][host-meta]
|
|
||||||
* [WebFinger draft][webfinger-draft]
|
|
||||||
* [Extensible Resource Descriptor (XRD) Version 1.0][xrd]
|
|
||||||
* [RFC 7033: WebFinger][webfinger-rfc]
|
* [RFC 7033: WebFinger][webfinger-rfc]
|
||||||
|
* [JSON Resource Descriptor (JRD)][jrd]
|
||||||
|
|
||||||
[host-meta]: https://tools.ietf.org/html/rfc6415
|
|
||||||
[webfinger-draft]: https://tools.ietf.org/html/draft-jones-appsawg-webfinger-06
|
|
||||||
[webfinger-rfc]: https://tools.ietf.org/html/rfc7033
|
[webfinger-rfc]: https://tools.ietf.org/html/rfc7033
|
||||||
[xrd]: http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html
|
[jrd]: https://www.packetizer.com/json/jrd/
|
||||||
[hcard]: {{ site.baseurl }}/discovery/hcard.html
|
[hcard]: {{ site.baseurl }}/discovery/hcard.html
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue