Name: Flarum
Homepage: https://flarum.org
Short description: PHP-based open source discussion platform
Optional API documentation URL: https://api.docs.flarum.org

Given Keyoxide is now using Flarum as discussion platform, why not support them as service provider as well? 😀

I don't think it's the right API documentation URL. I also believe the REST API isn't documented at all ☹️

So this is how far I got: https://community.keyoxide.org/api/users

This API lists all the users on the instance. Could be a good starting point.

Isn't there a user-specific API endpoint? Well yes, but: https://community.keyoxide.org/api/users/yarmo returns 404 not found ☹️

Apparently we need to give the ID: https://community.keyoxide.org/api/users/1

This is going to make it a bit complicated. Either the identity claims need to include the user ID which isn't great because the claim should just be https://community.keyoxide.org/u/yarmo.

A better solution would be to take the "all users" endpoint and then filter the JSON to find the right user. Dynamic JSON traversal is technically possible but isn't supported yet in the DOIP libraries. Could be added with relative ease.

2 years later

I've done a bit of dev work on flarum. the intial page (any page) payload in HTML with embedded JS data) and exposes API for subsequent rest calls, and is highly dependent on extensions, even for a bio.

1) They need to enable BIO extension
2) They need to make BIO public
3) Alternate on many sites could use Masquerade (advanced bios)

More interesting is that while you can get. aspecific user by numerical UID, to query by name is not guaranteed unique https://adkadv.com/api/users?filter[q]=eddie would also match names eddiest and teddie and so surest way to load bios/profiles are only available as an 'included' asset of another call, posts, which API does allow specific "author=name"

But proof with a bio would be easy:

  1. fetch posts with username as filter, their bio will be included (efficient API yeaH?)
  2. parse the included[].attributes.bio for matching user
#curl example
curl -kl "https://adkadv.com/api/posts?filter%5Bauthor%5D=eddie&filter%5Blimit%5D=1"  \
| \
jq '.included[] | select(.type=="users" and .attributes.username=="eddie") | .attributes.bio '

If still interested I am happy to help. I would even spin up a very simple openproof extension..

    a month later

    eddie Thanks for your research, I did something similar back in the day on Keyoxide matrix channel and here are my findings:

    The latest versions of flarum (still need to check which version introduced it) support script block with JSON payload on user pages.

    For example:

    curl -s 'https://discuss.flarum.org/u/luceos' \
      | pup '#flarum-json-payload[type="application/json"] text{}' \
      | jq -r '.apiDocument.data.attributes.bio'

    This will fetch the luceos' page, select the script tag with flarum-json-payload id and correct type for extra safety, grab inner text, and pass through the jq filter, finally resulting in their bio getting printed:
    https://ttm.sh/Bjh.jpeg

    And then it is just a matter of extracting fingerprint from bio string. You can see their profile here:
    https://discuss.flarum.org/u/luceos

    This doesn't work on Keyoxide flarum instance cause it uses an older version. Here is how it can be done on Keyoxide's flarum version. The page has script block with js boot snippet containing flarum.core.app.load(...); line. What gets passed to the load function is JSON containing user data.

    Shell snippet for your convenience:

    curl -s 'https://community.keyoxide.org/u/yarmo' \
      | fgrep 'flarum.core.app.load(' \
      | sed 's/^.*(//; s/).*$//' \
      | jq -r '.apiDocument.data.attributes'