Introduction
This guide will walk you through the process of securing your Intelligent Process Orchestrations API endpoints when building your Intelligent Process Orchestrations. We’ll cover authentication and authorization concepts in an easy-to-follow format, with the example focused on Quarkus.Why Security Matters
Before diving into implementation details, it’s important to understand why securing your API endpoints is critical:- Protect sensitive business data: Without proper security, your workflow data might be exposed
- Ensure proper access control: Different users need different levels of access
- Enable user-specific workflow tasks: User Tasks in stateful Workflows require knowing who’s who
- Meet compliance requirements: Many industries require specific security standards
Architectural Overview
When securing Intelligent Process Orchestrations APIs, the typical architecture involves:- Your Intelligent Process Orchestrations - Built using Quarkus or Spring Boot
- External Identity Provider (IdP) - Such as Keycloak or other Open ID Connect (OIDC) Providers
- Management Console - Which needs to connect to your secured workflow services
Authentication With Quarkus
Authentication verifies a user’s identity. Here’s how to implement it within Quarkus:Step 1: Add Required Dependencies
First, add the OpenID Connect (OIDC) extension (quarkus-oidc) to your pom.xml:
Step 2: Configure Authentication
Create or update yoursrc/main/resources/application.properties file with OIDC settings:
Key Property Explanations
Authorization With Quarkus
Authorization determines what an authenticated user can do. Here’s how to set it up:Step 1: Configure Path-Based Authorization
Add these properties to yourapplication.properties:
Step 2: Add Role-Based Authorization (Optional)
For more granular control, you can specify role-based permissions:Applying Security in Code
You can also enforce security at the code level using annotations:Enabling Management Console Connection
For the Management Console to connect to your secured Intelligent Process Orchestrations, follow these steps:Step 1: Add OIDC Proxy Extension to your Intelligent Process Orchestrations Proect
Add thequarkus-oidc-proxy dependency to your pom.xml:
Version 0.1.3 of quarkus-oidc-proxy is compatible with Quarkus 3.15 (LTS). With Quarkus 3.20 (LTS) 0.2.1 should be compatible and will be the version when Aletyx Enterprise Build of Kogito and Drools 10.1.0-aletyx is moved to the Quarkus 3.20+ release.
Step 2: Verify the Configuration
The OIDC Proxy extension will automatically create the required endpoints. Verify it’s working by checking:- The endpoint
/q/oidc/.well-known/openid-configurationshould be accessible - It should return information about your Identity Provider
Step 3: Test Your Connection
From the Management Console, try connecting to your Intelligent Process Orchestrations using:- The service URL (e.g. local deployment is at
http://localhost:8080/q) - Valid credentials from your Identity Provider
Troubleshooting Common Issues
CORS Configuration
If you have frontend applications accessing your APIs, you’ll need proper CORS configuration:Quarkus CORS Config
Spring Boot CORS Config
Common Error Resolution
Here are some common errors and their solutions:- 401 Unauthorized - Check your client credentials and OIDC server URL
- 403 Forbidden - User is authenticated but lacks required roles
- CORS errors - Verify your CORS configuration includes all needed origins
- Invalid token format - Ensure JWT token format matches IdP expectations
- Management Console can’t connect - Verify OIDC proxy is working correctly
Security Best Practices
When implementing API security, follow these best practices:- Use HTTPS everywhere - All API communications should be encrypted
- Implement token validation - Verify tokens haven’t been tampered with
- Set appropriate token lifetimes - Balance security with user experience
- Use specific scopes - Don’t request more permissions than needed
- Implement rate limiting - Prevent brute force attacks
- Log security events - Track authentication failures and suspicious activities
- Regular security testing - Test your APIs for vulnerabilities
Next Steps
Now that you’ve secured your API endpoints, consider exploring:- Multiple Identity Providers - Supporting more than one IdP
- Custom Authentication Logic - For special business requirements
- Fine-grained authorization - Beyond simple role-based access
- Security monitoring and alerting - For proactive security management