renewed webfinger

almost five years ago I have written about adding WebFinger support for your email. It has changed a lot since that time. First of all, now it has an official RFC7033 WebFinger. Second, it is switched from XML to the fashionable JSON. Lastly, it is now used in some even less popular systems

the idea remains the same, however, and it is still very simple to support it for your email: you just need to serve a small JSON file at URL https://example.com/.well-known/webfinger?resource=acct:email@example.com. Some complexity is only added by having the email as a query string parameter (and some clients not escaping special characters in contravention of specs)

nginx:

include mime.types;
types { application/jrd+json jrd; }

location = /.well-known/webfinger {
    if ($arg_resource = 'acct%3Aemail%40example.com') {
        rewrite .* /.well-known/email@example.com.jrd break;
    }
}

email@example.com.jrd:

{
  "subject": "acct:email@example.com",
  "aliases": ["https://example.com/"],
  "links": [
    {
      "rel": "http://webfinger.net/rel/avatar",
      "href": "https://example.com/favicon.svg"
    },
    {
      "rel": "http://webfinger.net/rel/profile-page",
      "href": "https://example.com/"
    }
  ]
}

this example only uses two link types, you can use all possible values for rel

Artemy Tregubenko,

comments powered by Disqus