Authentication
Plik supports multiple authentication providers. Enable with:
toml
FeatureAuthentication = "enabled" # Opt-in
# or
FeatureAuthentication = "forced" # All uploads require authLocal Accounts
Create users via the server CLI:
bash
./plikd --config ./plikd.cfg user create --login root --name Admin --admin
# Generated password for user root is 08ybEyh2KkiMho8dzpdQaJZm78HmvWGCGoogle OAuth
- Create an application in the Google Developer Console
- Get your Client ID and Client Secret
- Whitelist the redirect URL:
https://yourdomain/auth/google/callback
toml
GoogleApiClientID = "your-client-id"
GoogleApiSecret = "your-client-secret"
GoogleValidDomains = ["company.com"] # Optional: restrict to email domainsOVH
- Create an application at OVH API
- Get your Application Key and Secret
toml
OvhApiKey = "your-app-key"
OvhApiSecret = "your-app-secret"
OvhApiEndpoint = "https://eu.api.ovh.com/1.0" # Optional, defaults to EUOpenID Connect (OIDC)
Works with any OIDC provider (Keycloak, Authentik, Dex, etc.).
- Create a client application in your OIDC provider
- Set redirect URI to
https://yourdomain/auth/oidc/callback
toml
OIDCClientID = "plik"
OIDCClientSecret = "your-secret"
OIDCProviderURL = "https://keycloak.example.com/realms/myrealm"
OIDCProviderName = "Keycloak" # Optional: login button label
OIDCValidDomains = ["company.com"] # Optional: restrict by email domainDisabling Local Login
When using an external provider exclusively:
toml
DisableLocalLogin = trueThis hides the login/password form and rejects local login attempts.
CLI Tokens
Authenticated users can generate CLI tokens in the web UI or via the API. These tokens authenticate the CLI client, linking uploads to the user's account for quota tracking and management. They are sent via the X-PlikToken header or configured in .plikrc:
toml
Token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"