Login with Mastodon

So I would like to add a "Login with Mastodon" functionality to some of tools/sites and I am wrapping my head around the topic for some time now.

I see it elsewhere, brid.gy for example does this, so it's possible. But the thing is, it's a decentral network, (luckily) there is no central instance managing everything. And for what I can see, I need Client IDs and secrets in order to provide such a Login. But this I would need on every instance (as I also read here: https://charmed.blog/how-to-add-login-with-mastodon-using-nodejs/).

Is there any other possibility? I will try to figure out how elk.zone etc. does this. Creating app credentials on every platform wouldn't work and I do not want to support only some of them. 🤔

Do you how to do this, is there another way? Am I blind?