Support for mTLS within desktop & mobile #819
Replies: 1 comment 2 replies
-
I understand your use case for exposing OpenCloud behind an OAuth2 proxy while enabling mobile/desktop apps to bypass authentication using mTLS. After researching this, I'd like to propose an alternative approach that might be more elegant and require no changes to OpenCloud itself. The IdP-based mTLS SolutionSince OpenCloud already supports OpenID Connect with external IdPs, you can implement mTLS authentication at the IdP level instead. This approach works because:
How It Works
The flow remains standard OIDC from the app's perspective, but the IdP handles certificate-based authentication. Implementation with KeycloakOpenCloud has excellent Keycloak integration, and Keycloak fully supports mTLS authentication. Here's how to set it up: 1. Enable mTLS in Keycloak# Enable client certificate authentication
bin/kc.sh start --https-client-auth=required
# Configure truststore for client certificates
bin/kc.sh start --https-trust-store-file=/path/to/truststore.jks 2. Configure X.509 Authentication Flow
3. OpenCloud ConfigurationNo changes needed! OpenCloud continues to use standard OIDC. The mTLS authentication happens transparently at the IdP level. Benefits of This Approach
Other IdP OptionsWhile Keycloak has the best mTLS support among open-source IdPs, here's a comparison:
ConclusionInstead of implementing mTLS directly in OpenCloud's apps, leveraging the existing OIDC integration with an IdP that supports mTLS (like Keycloak) provides a cleaner, more maintainable solution. This approach:
The OAuth2 proxy remains in front of OpenCloud for browser access, while the mobile/desktop apps authenticate via OIDC to the mTLS-enabled IdP, receiving standard tokens that OpenCloud already knows how to handle. Would this approach work for your use case? Happy to discuss further or help with implementation details! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Please could you add support for mutual TLS (also known as TLS client authentication) within the mobile and desktop apps?
On Windows, ideally the certificate/path could be also be configured via registry so MDM solutions can roll this out at scale in enterprises.
Why
I want to expose OpenCloud to the internet behind an OAuth2 proxy (so a user needs to be authenticated for their request to reach OpenCloud). This could be bypassed if presenting a client certificate (mTLS) for authentication because the apps need to reach the API without facing redirects to login page etc from the reverse proxy.
This feature is something which I foresee being used by both advanced homelab users, and enterprises with high security standards.
Similar
Immich, a Google Photos alternative supports mTLS - immich-app/immich#10860
Users using Cloudflare Access can use mutual TLS with Cloudflare Enterprise but homelab users can use Cloudflare Access service tokens which simply needs two headers to bypass authentication. So in addition, supporting adding headers to requests would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions