code-specialist / fastapi-keycloak

Keycloak integration for Python FastAPI
https://fastapi-keycloak.code-specialist.com/
Apache License 2.0
192 stars 49 forks source link

Can we pass dynamic realm, client_id and client_secret params to FastAPIKeycloak class #80

Open Udayaprasad opened 1 year ago

Udayaprasad commented 1 year ago

I am looking for a multi-tenant-based solution, where the customer maintains different realms for different vendors. How could we manage the FastAPIKeycloak() creation and .get_current_user() authentication/authorisation?

Based on the URL I am figuring out the tenant and getting the relevant Database details, but now confused about how we could use the below OIDCUser in the Endpoint definition.

user: OIDCUser = Depends(keycloak_obj.get_current_user())

@yannicschroeer