Skip to content

"Something went wrong setting up your Micropub endpoint" when adding an external IndieAuth/Micropub site #144

Description

@svandragt

App Version: 3.6.6 (build 434)

What happens

I'm trying to add my own self-hosted Micropub blog as a posting target in the Micro.blog iOS app, and it fails with the modal: "Sorry, something went wrong setting up your Micropub endpoint. Please try again."

The IndieAuth sign-in itself looks fine – the login and the GitHub confirmation both go through, and there's a redirect chain back into the app – but setup then falls over before my Micropub endpoint is ever contacted. The same site connects fine from other Micropub clients, so the endpoints themselves are working.

There's a long-running thread on the help forum describing the same thing, where it was put down to an app-side regression: https://help.micro.blog/t/debugging-micropub-setup/1995 ("This used to work but
something broke when we rewrote the app.")

How to reproduce

  1. Have a self-hosted site that advertises authorization_endpoint, token_endpoint and micropub rel links and
    passes micropub.rocks. Mine uses authorization_endpoint = https://indieauth.com/auth and token_endpoint =
    https://tokens.indieauth.com/token.
  2. Add the site as a Micropub posting target in the iOS app.
  3. Complete the IndieAuth login via GitHub and approve.
  4. The error modal appears after the redirect chain.

What I expected

The app completes the token exchange, gets an access token, queries the Micropub endpoint with q=config, and registers the site.

What actually happens

It fails at the auth step. I added request logging to my Micropub server, and during a failed setup nothing from the iOS app ever reaches the Micropub endpoint – the only Micropub traffic I see is from other clients. So whatever goes wrong, it goes wrong during the IndieAuth token exchange, before Micropub is involved at all.

The code I think is involved

The auth-code capture and the token-exchange request are here:

async verify_code(service, auth_url) {
const regex = /[?&]code=([^&]+)/
const match = regex.exec(auth_url)
if (match) {
const auth_code = match[1];
console.log("Micropub: Got code:", auth_code);
console.log("Micropub: Sending to", service.token_endpoint)
var params_s = ""
params_s = params_s + "client_id=" + encodeURIComponent("https://micro.blog/")
params_s = params_s + "&code=" + encodeURIComponent(auth_code)

Someone on the forum thread above reckons the encoding of the auth code in that request is the trigger – they said that dropping the encodeURIComponent and sending the auth_code raw makes verification succeed. I haven't verified that myself, so I'm not claiming it as the cause; I'm just pointing at the code path that lines up with what I'm seeing.

Environment

  • Micro.blog for iOS, version 3.66 (build 434)
  • iOS 26.5.
  • Other Micropub iOS clients (iA Writer) connect to the same site without trouble, and the site passes
    micropub.rocks.
  • Auth/token endpoints: indieauth.com / tokens.indieauth.com.

Anything else

Reported by a few people on the forum since at least September 2024, and the macOS client apparently works, so this seems to be iOS only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions