Control granular de roles para Logic App Standard con APIM y Easy Auth

Guía para control de acceso granular por roles en Logic App Standard con Easy Auth y APIM: registrar roles, validar JWT y enrutar a los triggers de cada workflow.

24 sept 2025 • 4 min read • Q2BSTUDIO Team

Inteligencia-Artificial-

Control granular de roles para Logic App Standard con APIM y Easy Auth: en este artículo explico cómo combinar la autenticación de Easy Auth en Logic App Standard con Azure API Management APIM para aplicar control de acceso basado en roles antes de que la petición llegue al flujo de trabajo.

1. Registrar roles de aplicación: en la App Registration de Entra ID que representa tu API crea roles como wf_arithmetic_add wf_arithmetic_sub y wf_arithmetic_mul. Asigna esos roles a los service principals o usuarios que deban tener permiso. Una vez que se consientan, los roles aparecerán en el panel de permisos de la API.

2. Incorporar Logic App Standard en APIM: actualmente APIM no ofrece un asistente de importación directa para Logic App Standard con Easy Auth activado, por lo que se crea la API manualmente. En APIM crea una API nueva por ejemplo LAStandardAPI y añade operaciones como Add Sub Mul que reflejen tus triggers o acciones del workflow. Configura el backend de cada operación para apuntar al endpoint HTTPS del Logic App ya protegido por Easy Auth.

Consejo práctico: usa un nombre consistente para el trigger HTTP en cada workflow por ejemplo RcvReq. Evita depender del token SAS sig en la URL cuando frontalices con APIM. En su lugar construye la URL del backend de forma dinámica y aplica una política de rewrite-uri o set-backend-service en APIM. Patrón de backend ejemplo: https://mylogicapp.azurewebsites.net/api/wf_arithmetic_add/triggers/RcvReq/invoke?api-version=2022-05-01. En el frontend de APIM puedes mapear rutas limpias como /api/wf_arithmetic_add hacia el backend dinámico correspondiente. De este modo todas las llamadas al workflow pasan por la validación JWT y ya no dependen solo de tokens SAS.

3. Validar el JWT en APIM: en la política inbound global o por operación usa validate-jwt apuntando a la configuración OpenID de tu tenant v2 por ejemplo https://login.microsoftonline.com/TENANT_ID/v2.0/.well-known/openid-configuration y acepta emisores como https://sts.windows.net/TENANT_ID/. Cuando la validación falla devuelves 401 Unauthorized. Opcionalmente puedes incluir un bloque audiences para exigir el audience de la API.

En la misma política inbound extrae el token del header Authorization, parsea las claims roles y genera una lista CSV de roles. Calcula el nombre del workflow solicitado a partir de la ruta de la petición, por ejemplo extrayendo el segmento final de /api/wf_arithmetic_add. Comprueba si la lista de roles contiene el nombre del workflow solicitado. Si la comprobación pasa permite el flujo hacia el backend, si no devuelve 403 Forbidden con un cuerpo JSON indicando error Role missing or invalid. Finalmente reescribe la URI de frontend a la ruta del trigger en el Logic App por ejemplo /api/{wf}/triggers/RcvReq/invoke?api-version=2022-05-01 para que APIM adelante la petición al trigger correcto.

4. Validación y pruebas: una vez aplicada la política en APIM prueba con tokens que incluyan distintos roles. Caso autorizado: un token que contenga wf_arithmetic_add podrá invocar /api/wf_arithmetic_add y obtendrá 200 OK. Caso no autorizado: el mismo token si llama a /api/wf_arithmetic_mul sin contener wf_arithmetic_mul será rechazado con 403 Forbidden y el JSON de error correspondiente.

Beneficios de este enfoque: seguridad reforzada al aplicar control de acceso basado en roles en la puerta de entrada API en lugar de depender solo de SAS tokens, trazabilidad y centralización de políticas, y facilidad para exponer APIs limpias hacia clientes mientras se mantiene la protección de los workflows internos.

En Q2BSTUDIO como empresa de desarrollo de software y aplicaciones a medida combinamos capacidades de integración cloud y seguridad para ayudarte a desplegar soluciones robustas. Si necesitas construir APIs seguras o desarrollar un workflow a medida podemos ayudarte a diseñar la integración entre Logic Apps y APIM y a implementar políticas de validación JWT y control de roles. Consulta nuestros servicios de desarrollo de aplicaciones a medida en desarrollo de aplicaciones y software multiplataforma y nuestros servicios cloud en servicios cloud AWS y Azure.

Además ofrecemos experiencia en inteligencia artificial IA para empresas, agentes IA, power bi y servicios inteligencia de negocio, así como en ciberseguridad y pentesting para proteger tus integraciones. Palabras clave relevantes para tu posicionamiento: aplicaciones a medida, software a medida, inteligencia artificial, ciberseguridad, servicios cloud aws y azure, servicios inteligencia de negocio, ia para empresas, agentes IA y power bi.

Si quieres que Q2BSTUDIO implemente este patrón de control granular de roles en tu entorno Azure, optimice la adopción de APIM o desarrolle soluciones a medida con foco en seguridad y automatización ponte en contacto y te asesoramos en la mejor arquitectura y en la implementación técnica.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Artificial intelligence

AI agents, chatbots, and intelligent assistants that automate tasks and serve your customers 24/7 to improve the efficiency of your business.

More info

Software Development

Web, mobile, and desktop applications, intranets, e-commerce, SaaS, and management platforms designed for your company's specific needs.

More info

Cloud services

Migration, infrastructure, managed hosting, high availability, and security on Microsoft Azure and Amazon Web Services to help your business scale without limits.

More info

Cybersecurity and pentesting

Security audits, penetration testing and protection of applications, data and infrastructure on-premise and cloud, with ethical hacking and regulatory compliance.

More info

Business Intelligence

Dashboards and data analysis with Power BI: we integrate your sources, design dashboards and KPIs and turn your data into decisions.

More info

Process automation

We automate repetitive tasks and connect your applications with n8n, Power Automate, Make, and RPA, eliminating manual work and increasing productivity.

More info

Training for Companies

We train your teams in technology with criteria: web development, databases, Git, best practices and security, automation with n8n, artificial intelligence for companies and creation of AI solutions with Azure AI Foundry.

More info

Code Auditing

We audit the code that you, your team or an AI create: we tell you what is good and what to improve, we secure it and make it ready for production, web or app.

More info

AI Image Generation

We create for you the images that your business needs with artificial intelligence: product, networks, advertising, illustration and avatars. You tell us what you want and we deliver it ready to use.

More info

AI Video Generation

We create videos with artificial intelligence for you: promotional, networking, virtual presenters, dubbing and animations. You tell us the idea and we will deliver it assembled and ready to publish.

More info

AI Conversational Avatars

We create conversational avatars with AI – digital humans with a face and voice – that serve your customers and teams with the knowledge of your company, on your website, interactive monitors, WhatsApp or Teams.

More info

Online Marketing and AI

Google Ads, Meta Ads, LinkedIn Ads and AI Engine Positioning (GEO/AEO): we attract customers and make your brand appear where they search for you, also on ChatGPT, Gemini and Perplexity.

More info

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.

Live Chat