What are some ways someone could go about this? For example, CAPTCHA and email verification, but how to dynamically generate temporary API keys for e.g., MQTT?
Thoughts on other solutions, including those for different communication protocols?
You could utilize a similar pattern to 0Auth 2.0 which is very common. You could set restrictions on how long the access token is valid for, how much it can be used, and how often it can be refreshed.
This was very helpful, thanks! At least for a first pass, I will try the JWT tokens issued by Auth0 and passed to a HiveMQ “Starter Plan” broker. Still figuring out the details, such as the web app for requesting a token (perhaps a Streamlit Web App in Hugging Face Spaces [2] or a Flask App in PythonAnywhere), since it seems like I can’t host that natively in Auth0.
If you use a public client, a small “serverless” app (means: hostable on Github pages) can be build e.g. with the keycloak js-lib (Securing Applications and Services Guide).
With device-flow enabled, clients could also run on the command line.
I’ll have a look! A well accepted cloud hosted and “hands-off” option is appealing, but perhaps the one you mentioned is straightforward enough to implement with JWT and a JWKS endpoint.
We’re abandoning Auth0 for now. Hosting a keycloak instance on digital ocean or on github pages / readthedocs / etc. might be a good solution in the long-term. Right now, the other person working on this is going to use the HiveMQ API (still requires paid Starter Plan) to generate random access credentials and remove the old one when new credentials are created (and return some kind of error message if it’s too soon to create new credentials).