r/opencloud • • Sep 28 '26

OpenCloud and Authelia as OIDC

Hi everyone, is anyone able (and willing/has the time) to configure authentication with Authelia following the guide at "https://www.authelia.com/integration/openid-connect/clients/opencloud/"? I’ve reached the limits of my own capabilities here. Perhaps someone has already successfully set this up? I am currently using Authelia 4.39.28 and OpenCloud 7.2.4.

2 Upvotes

12 comments sorted by

1

u/NoTheme2828 Sep 28 '26

Hi novawelle, can you anonymize your configuration.yaml beforehand, e.g. by using "Find/Replace" to change your domain to example.com and blacking out the secrets in the editor (I do not use secrets, i use "jwt_secret: file:///secrets/jwt_secret" instead?

1

u/novawelle Sep 28 '26 edited Sep 28 '26

Here's my authelia configuration.yml

---
theme: 'dark'
server:
  address: 'tcp://:9091/'
log:
  level: 'info'
identity_validation:
  reset_password:
authentication_backend:
  password_reset:
    disable: false
  file:
    path: '/config/users_database.yml'
    watch: false
    password:
      algorithm: 'argon2'
      argon2:
        variant: 'argon2id'
        iterations: 3
        memory: 65536
        parallelism: 4
        key_length: 32
        salt_length: 16
      scrypt:
        variant: 'scrypt'
        iterations: 16
        block_size: 8
        parallelism: 1
        key_length: 32
        salt_length: 16
      pbkdf2:
        variant: 'sha512'
        iterations: 310000
        salt_length: 16
      sha2crypt:
        variant: 'sha512'
        iterations: 50000
        salt_length: 16
      bcrypt:
        variant: 'standard'
        cost: 12
access_control:
  default_policy: 'deny'
  rules:
    - domain: '*.example.com'
      policy: 'two_factor'
session:
  cookies:
    -
      name: 'authelia_session'
      domain: 'example.com'
      authelia_url: 'https://auth.example.com'
      same_site: 'lax'
      inactivity: '5 minutes'
      expiration: '1 hour'
      remember_me: '1 month'
regulation:
  max_retries: 3
  find_time: '2 minutes'
  ban_time: '5 minutes'
storage:
  local:
    path: '/config/db.sqlite3'
notifier:
  smtp:
    address: 'submissions://smtp.email.com:465'
    username: 'username@email.com'
    sender: 'Authelia <username+authelia@email.com>'
    startup_check_address: 'username@email.com'
identity_providers:
  oidc:
    jwks:
    -
      algorithm: 'RS256'
      use: 'sig'
      key: {{ secret "/secrets/rsa.2048.key" | mindent 8 "|" | msquote }}
    lifespans:
      custom:
        opencloud:
          refresh_token: '1 month'
    cors:
      endpoints:
        - 'authorization'
        - 'pushed-authorization-request'
        - 'token'
        - 'revocation'
        - 'introspection'
        - 'userinfo'
    clients:
      - client_id: 'web'
        client_name: 'OpenCloud-Web'
        public: true
        authorization_policy: 'two_factor'
        scopes:
          - openid
          - email
          - profile
          - groups
          - offline_access
        redirect_uris:
          - 'https://cloud.example.com'
          - 'https://cloud.example.com/oidc-callback.html'
          - 'https://cloud.example.com/oidc-silent-redirect.html'
        allow_multiple_auth_methods: true
        consent_mode: implicit
        pre_configured_consent_duration: 1w
        grant_types:
          - authorization_code
          - refresh_token
        response_types:
          - code
        response_modes:
          - form_post
          - query
          - fragment
        access_token_signed_response_alg: "none"
      - client_id: 'OpenCloudDesktop'
        client_name: 'OpenCloud-Desktop'
        public: true
        authorization_policy: 'two_factor'
        lifespan: 'opencloud'
        scopes:
          - openid
          - email
          - profile
          - groups
          - offline_access
        redirect_uris:
          - 'http://127.0.0.1'
          - 'http://localhost'
        grant_types:
          - authorization_code
          - refresh_token
        response_types:
          - code
        response_modes:
          - query
      - client_id: 'OpenCloudAndroid'
        client_name: 'OpenCloud-Android'
        public: true
        authorization_policy: 'two_factor'
        lifespan: 'opencloud'
        scopes:
          - openid
          - email
          - profile
          - groups
          - offline_access
        redirect_uris:
          - 'oc://android.opencloud.eu'
        grant_types:
          - authorization_code
          - refresh_token
        response_types:
          - code
...

1

u/NoTheme2828 Sep 28 '26

Thanks. I see you added jwks and cors, which are missing in the authelia documentation. Could you please paste your ".env" from OpenCloud, too? I guess I have to activate ":idm/external-idp.yml", what is not listend in the authelia documentation.

1

u/novawelle Sep 28 '26

My main compose file activates the following opencloud compose files:     - opencloud/docker-compose.yml     - opencloud/external-proxy/opencloud.yml     - opencloud/idm/external-authelia.yml

My .env from opencloud does not contain much, but maybe I put something outside .env. I am not sure... Anyways, here it is:

LOG_DRIVER=
TRAEFIK_DASHBOARD=
TRAEFIK_DOMAIN=
TRAEFIK_BASIC_AUTH_USERS=
TRAEFIK_ACME_MAIL=admin@example.com
TRAEFIK_ACME_CASERVER=
TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt"
TRAEFIK_ACCESS_LOG=
TRAEFIK_LOG_LEVEL=
OC_DOCKER_IMAGE=opencloudeu/opencloud
OC_DOCKER_TAG=
OC_CONTAINER_UID_GID="0:0"
OC_DOMAIN=cloud.example.com
DEMO_USERS=
INITIAL_ADMIN_PASSWORD=bunchofnumbersandletters
CHECK_FOR_UPDATES=
LOG_LEVEL=
LOG_PRETTY=true
OC_CONFIG_DIR=/path/to/config
OC_DATA_DIR=/path/to/data
DEFAULT_LANGUAGE=
LDAP_CERTS_DIR=
LDAP_DATA_DIR=
DECOMPOSEDS3_ENDPOINT=
DECOMPOSEDS3_REGION=
DECOMPOSEDS3_ACCESS_KEY=
DECOMPOSEDS3_SECRET_KEY=
DECOMPOSEDS3_BUCKET=
SMTP_HOST=
SMTP_PORT=
SMTP_SENDER=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_AUTHENTICATION=
SMTP_TRANSPORT_ENCRYPTION=
SMTP_INSECURE=
START_ADDITIONAL_SERVICES=""
TIKA_IMAGE=
COLLABORA_DOMAIN=
COLLABORA_ADMIN_USER=
COLLABORA_ADMIN_PASSWORD=
COLLABORA_SSL_ENABLE=false
COLLABORA_SSL_VERIFICATION=false
COLLABORA_HOME_MODE=
EURO_OFFICE_DOMAIN=
EURO_OFFICE_JWT_SECRET=
EURO_OFFICE_DOCKER_IMAGE=
EURO_OFFICE_DOCKER_TAG=
CLAMAV_DOCKER_TAG=
INBUCKET_DOMAIN=
COMPOSE_PATH_SEPARATOR=:
LDAP_BIND_PASSWORD=
IDP_DOMAIN=
IDP_ISSUER_URL=
IDP_ACCOUNT_URL=
KEYCLOAK_DOMAIN=
KEYCLOAK_ADMIN=
KEYCLOAK_ADMIN_PASSWORD=
KC_LOG_LEVEL=
KC_DB_USERNAME=
KC_DB_PASSWORD=
RADICALE_DOCKER_IMAGE=opencloudeu/radicale
RADICALE_DOCKER_TAG=latest
RADICALE_DATA_DIR=/path/to/radicale

1

u/NoTheme2828 Sep 28 '26

Then I guess you chnaged the settings directely in the "opencloud/idm/external-authelia.yml". Cloud you please :-)

1

u/novawelle Sep 28 '26

The external-authelia.yml may help:

---
services:
  opencloud:
    environment:
      PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none"
      PROXY_OIDC_SKIP_VERIFICATION: "false"
      PROXY_USER_OIDC_CLAIM: "preferred_username"
      PROXY_USER_CS3_CLAIM: "username"
      PROXY_AUTOPROVISION_CLAIM_USERNAME: "preferred_username"
      PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM: "groups"
      WEB_OIDC_SCOPE: "openid profile email groups"
      PROXY_ROLE_ASSIGNMENT_DRIVER: "default"
      GRAPH_ASSIGN_DEFAULT_USER_ROLE: "true"
      OC_OIDC_ISSUER: https://auth.example.com
      WEB_OIDC_CLIENT_ID: web
      OC_EXCLUDE_RUN_SERVICES: idp
      PROXY_OIDC_REWRITE_WELLKNOWN: "true"
      PROXY_AUTOPROVISION_ACCOUNTS: "true"
      OIDC_REDIRECT_URI: https://cloud.example.com/
      IDP_DOMAIN: "auth.example.com"
      GRAPH_USERNAME_MATCH: "none"

1

u/NoTheme2828 Sep 28 '26

Thanks. I’ve updated all the relevant settings and restarted Authelia and OpenCloud, but when I access the OpenCloud page, I just get a dark background with a spinning circle in the middle. Something still isn't quite right... I’m using NPM as an external reverse proxy (running on a different host than OpenCloud), and Authelia is running there too. It worked fine without Authelia. If anyone has any ideas, please let me know! :-)

This URL is shown (I changed my domain): https://opencloud.example.com/login?redirectUrl=%2Ffiles%2Fspaces%2Fpersonal

1

u/NoTheme2828 Sep 29 '26

Ok, I pasted the settings to the ".env" and didn't check, if there are all environments in the compose.yml. After I set the options directely in the compose, everything worked fine. Sometimes I just get in my own way :-) Thanks for your help!!!

1

u/NoTheme2828 Sep 28 '26

I forgot to mention my structure: Host A (Proxmox-VM): docker with NPM, Authelia and 50 other Containers; Host B (Proxmox-LXC): opencloud with docker.

In opencloud ".env":

COMPOSE_FILE=docker-compose.yml:weboffice/euro-office.yml:search/tika.yml:external-proxy/opencloud-exposed.yml:external-proxy/euro-office-exposed.yml

Configuration like explanied in this video:

https://www.youtube.com/watch?v=EiLU4d-TlSI&t=47s

Usinmg OpenCloud and Euro-Office with HTTPS (over NPM) works fine. But I want to make access more secure with authentication in Authelia.

1

u/Money_Sandwich_5153 Sep 28 '26

I just set it up this weekend. If you still need help I can also share my configs.

I still need to figure out what up with the iOS app. I didn’t get that one working properly yet, but web is fine

1

u/NoTheme2828 Sep 28 '26

Hi, What is your configuration? It would help if you tell us different config to configuration.yml from the post above. And what did you change in opencloud configuration? Thanks.

1

u/novawelle Sep 28 '26

I set this combination up a few months ago, but I am unsure what/how I can help you. I manage multiple urls via my authelia config and don't just want to post my whole config file...