The integration currently uses digest authentication (username/password) because pCloud's OAuth2 developer portal has been unavailable. This document explains how to switch between authentication methods.
- Status: ✅ Active
- Why: pCloud developer portal unavailable for OAuth2 registration
- Security: Uses SHA1 hashing with digest tokens
- Reference: pCloud Authentication Docs
- Status: 🔒 Ready but disabled
- Why: Requires OAuth2 app registration via developer portal
- Security: Industry-standard OAuth2 flow
- Status: Portal has been unavailable since at least January 2025
The integration uses an abstraction layer (auth.py) that supports both methods:
# In auth.py
USE_OAUTH2 = False # Set to True to enable OAuth2
def create_auth(...):
if USE_OAUTH2 and access_token:
return PCloudOAuth2Auth(...)
elif username and password:
return PCloudDigestAuth(...)- Edit
custom_components/pcloud_backup/auth.py - Change
USE_OAUTH2 = FalsetoUSE_OAUTH2 = True
- Edit
custom_components/pcloud_backup/config_flow.py - Uncomment the
PCloudOAuth2FlowHandlerclass (it's at the bottom of the file) - Comment out or remove the
PCloudConfigFlowclass for digest auth
- Navigate to pCloud Developer Portal
- Log in and register a new application
- Configure redirect URI:
https://your-ha-instance:8123/auth/external/callback - Copy Client ID and Client Secret
The OAuth2 flow handler uses Home Assistant's built-in OAuth2 system. Credentials are typically configured in the integration's OAuth2 implementation setup.
- Remove existing integration entry
- Add integration again via UI
- You should see OAuth2 authentication flow instead of username/password
- Set
USE_OAUTH2 = Falseinauth.py - Use the
PCloudConfigFlowhandler inconfig_flow.py - Users can authenticate with username/password
custom_components/pcloud_backup/
├── auth.py # Authentication abstraction layer
│ ├── PCloudAuth # Abstract base class
│ ├── PCloudDigestAuth # Current implementation
│ └── PCloudOAuth2Auth # OAuth2 implementation (ready)
├── api.py # Uses auth abstraction (no changes needed)
└── config_flow.py # Contains both flow handlers
├── PCloudConfigFlow # Current (digest)
└── PCloudOAuth2FlowHandler # Future (OAuth2, commented)
- Easy switching: Single flag controls authentication method
- No breaking changes: API layer doesn't need modification
- Future-proof: Ready for OAuth2 when portal is restored
- Backward compatible: Existing users can continue with digest auth
- ✅ Passwords are hashed before transmission
- ✅ Uses pCloud's recommended digest method
⚠️ Requires storing password in Home Assistant- ✅ All communication over HTTPS
- ✅ Industry-standard security
- ✅ No password storage required
- ✅ Token-based authentication
- ✅ Better for third-party integrations