"Sorry, you do not have the required trust level to access the user API" when on iOS

AI-generated summary

A user r333d reported issues signing up via the Discourse mobile app on iOS, encountering the error “Sorry, you do not have the required trust level to access the user API” after linking their GitHub account. ChrisBeach identified the cause: a site setting controlling minimum trust level for API access, which defaults to a non-zero value, blocking new users. They suggested lowering it to zero for better usability, noting it’s likely an oversight. sam proposed changing the default setting to zero, prompting codinghorror to ask about security implications. sam reassured that the risk is low since API key acquisition requires web access and user scripting is already possible via cookies. codinghorror approved the change, and sam confirmed it was implemented in a commit here. The fix ensures new users can access the mobile app without hitting the trust-level barrier.

Hey, so I’m trying to check out the mobile app for Discourse, and I’ve ran into a few issues already.

First off, it’s impossible to sign up through the mobile app, or at least, for me, it was not intuitive at all. I tried linking my Github account, which “worked” but didn’t take me to any sort of sign up page. So I had to do it on desktop.

And now, after successfully signing up, it says this:

Authorize application access

Sorry, you do not have the required trust level to access the user API

What do I have to do to get rid of that?

There’s a setting which you may want to adjust:

If it’s not set to zero, new users won’t be able to use the Discourse mobile app.

To me this seems a usability oversight, and I quickly changed the setting to zero when I realised what was happening to our new users.

However, I’m sure there’s a rationale for the default setting being non-zero.

@codinghorror you ok with me bumping the default to 0

What are the security implications for all new users to be able to get API keys?

very low risk, protocol for getting a key requires web access. If you can script that you can script a user anyway using cookies

If you think it is safe then I am OK with it.

Done per:

https://github.com/discourse/discourse/commit/8f7062bd7b2726042bbadf2623ccdca04eab535b