Context: We first developed an SPA in react with a python-based backend that performs machine learning task. SPA is hosted on GCP. The database server in backend is also indirectly accessed via this flask server. auth0 for authetication works great. We then developed the desktop app. Electron was used for various reasons. The audience designated for desktop app works fine.
Problem: Since we now wish to support the users for both web-based application as well as desktop based one, we end up having two different audiences. We cant afford to have two separate machine learning backend servers.
Question: Can we have a single backend server, catering to multiple audiences?
For example, using JWT in python when we try to determine payload (see snippet below), is it fine if we iterate over multiple audiences? Are there any down-sides?
payload = jwt.decode(
token,
rsa_key,
algorithms=ALGORITHMS,
audience=API_AUDIENCE,
issuer="https://" + AUTH0_DOMAIN + "/",
)