Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
AWS Cognito and Row Level Security in RDS PostgreSql

I have two B2B apps, one for suppliers and the other for purchasers. The supplier app is a .NET Core app fully hosted in AWS, users are authenticated in Cognito, API gateway is used, RDS, ECS, etc. The second app is older and not hosted in AWS. The AWS app owns the REST API and the other app needs to leverage that API for certain things. I'd like to setup row-level security in Postgres so that queries made by suppliers filter by supplier_id and the ones made by purchasers filter by purchaser_id. My understanding is that the best way to do RLS is to use Postgres settings/variables and then have your policy leverage something like current_setting('app.supplier_id') or current_setting('app.purchaseorder_id') to filter the data. I'm just not sure how to tie all this together.

The simple way that comes to mind is to setup an app client in Cognito and enable client credentials grant type, then the second app could leverage that to get a token. When a request to the API is made, a middleware would check the JWT token and use a different account based on if it's a supplier or purchaser accessing. It would then also set an app.supplier_id or app.purchaser_id on the Postgres connection and the RLS would take care of the rest. I'm just not sure this is the best approach or if there would be a more elegant way.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda