Skip to content

External OIDC seems not functional #455

@enticedwanderer

Description

@enticedwanderer

Describe the bug

It doesn't seem possible to utilize external IDP currently, at least not via OAUTH2/OIDC. Migrating existing configuration from previously working owncloud setup, opencloud now tries to do a XHR GET to external IDP well known location and can't because of CORS. We shouldn't be needing CORS to begin with with a normal redirect, if opencloud was doing OIDC to spec.

Perhaps I need to customize further settings? Am I missing anything else needed to get external auth functional?

Steps to reproduce

  1. Set up environment variables or config for external IDP use.
  2. Set up external IDP OIDC issuer (I used Authentik)
  3. Start opencloud and try to login

Expected behavior

Opencloud should redirect me to external OIDC.

Actual behavior

It fails with CORS error while opening a normal opencloud page.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://authentik.home.lan/application/o/opencloud/.well-known/openid-configuration. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Setup

Standard docker setup as provided in the git repo. Additional env variables for opencloud container.

Details

      # OIDC config
      PROXY_AUTOPROVISION_ACCOUNTS: "true"
      PROXY_OIDC_REWRITE_WELLKNOWN: "true"
      PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none"
      OC_OIDC_ISSUER: https://authentik.home.lan/application/o/opencloud/
      WEB_OIDC_CLIENT_ID: JRf59P10id6LvrNiHDj3XGvT4DvqW2k0Kmwpjhaj
      WEB_OIDC_SCOPE: "openid profile email offline_access"

Additional context

Note that removing the configuration above and falling back to internal IDP everything seems to function as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions