“Codeless” backend using PostgreSQL, PostgREST and Keycloak
mathieupassenaud.fr
“Codeless” backend using PostgreSQL, PostgREST and Keycloak
1–4 of 4 posts
Re: “Codeless” backend using PostgreSQL, PostgREST and Keycloak
#2The article mentions a PostgREST endpoint "/rpc/add_user_if_not_exists". Do I need to set up Keycloak to perform a POST request on this endpoint upon a new user registering via Keycloak?
Or can this be done for all requests by simply executing "api.add_user_if_not_exists()" before all other queries, hereby assuming that whatever is in "request.jwt.claim.sub" has been verified by Keycloak?
Re: “Codeless” backend using PostgreSQL, PostgREST and Keycloak
#3Regarding the "users" table: how are users registered with Keycloak saved to the app DB? I assume this is necessary if I want to use Postgres row-level security. Is Keycloak set up to store newly created users in the app DB? The article mentions a PostgREST endpoint "/rpc/add_user_if_not_exists". Do I need to set up Keycloak to perform a POST request on this endpoint upon a new user registering via Keycloak? Or can t…
In this case, we use this procedure from the frontend app. When a user registers on Keycloak, this user is only stored on Keycloak.
Keycloak is used as an authentication provider, a "login with". The user is registered in the app on first use, even if the account already exists in Keycloak.
so, calling "api.add_user_if_not_exists" can be used on every request, only the first has an effect.
The field request.jwt.claim.sub is called "subject", this is a unique identifier for the user (a GUID with Keycloak). This field is provisionned by Keycloak, the JWT token has been verified by Postgrest with all informations (Keys).
Re: “Codeless” backend using PostgreSQL, PostgREST and Keycloak
#4Regarding the "users" table: how are users registered with Keycloak saved to the app DB? I assume this is necessary if I want to use Postgres row-level security. Is Keycloak set up to store newly created users in the app DB? The article mentions a PostgREST endpoint "/rpc/add_user_if_not_exists". Do I need to set up Keycloak to perform a POST request on this endpoint upon a new user registering via Keycloak? Or can t…
Hi, In this case, we use this procedure from the frontend app. When a user registers on Keycloak, this user is only stored on Keycloak. Keycloak is used as an authentication provider, a "login with". The user is registered in the app on first use, even if the account already exists in Keycloak. so, calling "api.add_user_if_not_exists" can be used on every request, only the first has an effect. The field request.jwt.c…