How sample/pritunl-keycloak-user-check works
Main Components
• Pritunl VPN Server – Represents the core VPN service that is extended through plugins.
• Plugin (keycloak-user-check.py) – The Python script responsible for intercepting VPN connection attempts and communicating with Keycloak.
• Keycloak Server – The external authentication service that provides user status and credential verification.
• Configuration/Integration Layer – Although not a separate service, visually emphasize the configuration parameters (KEYCLOAK_URL, REALM, CLIENT_ID, CLIENT_SECRET, etc.) that tie together the plugin’s interactions with Keycloak.
Their Relationships and Interactions
• Configuration parameters between the plugin and Keycloak to show how the integration is parameterized.
Architectural Patterns and Design Principles
• Middleware/Plugin Pattern – The plugin acts as an interceptor, managing authentication flow between the VPN and the external IdP.
• Dependency on External Services – Clearly note that Keycloak’s availability is crucial for VPN access, indicating a tight coupling for authentication purposes.
• Real-time Data Flow – Emphasize the fact that user status checking happens in real time during connection attempts.
Incorporate Relevant Technologies and Libraries
• Python Script: keycloak-user-check.py is implemented in Python.
• Keycloak: Uses OpenID Connect for authentication.
• Pritunl: The VPN server that supports plugins for extended authentication and security.
Final Points
• Avoid over-cluttering—focus on clearly separating the three key components and their interactions.
This approach provides a comprehensive visual aid for understanding and maintaining the integration between Pritunl and Keycloak using the keycloak-user-check plugin.