Skip to content

oAuth apps missing in databases - Client authentication failed #27740

@hugogameiro

Description

@hugogameiro

Steps to reproduce the problem

Attempt to authenticate using oAuth

Expected behaviour

Authorization confirmation page

Actual behaviour

Page with error: Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.

Detailed description

As mentioned in snarfed/bridgy#1602 (comment), the problem seems to be related to the app being deleted from the oauth_applications database table.

My assumption is that the first time someone on an instance attempts to authenticate with that app, it all works, the app information is stored in the oauth_applications, and the remote developer stores the uid.

Then the user ends up never using that app or removing the authorization from their account "Authorized Apps". This should not delete the app from oauth_applications because the remote developer still believes the uid exists.

Months later, when that user or another user on the instance attempts to authenticate again, the remote app requests to authenticate with the uid they have stored, and the authentication fails with Doorkeeper invalid_client: "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method".

I have reports of this issue happening with Buffer, Bridgy and elk.zone. I could confirm this issue on a couple of instances that I host and on other instances not hosted by me.

Mastodon instance

Multiple

Mastodon version

v4.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus/to triageThis issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions