OAuth2 with Seafile CE 13

Hi.

I’m planing to upgrade my seafile 12 CE to version 13. I’m using the Docker install (well, not directly the official docker-compose, as I use Hashicorp Nomad).

I’m using OAuth2 against an internal OIDC provider (Lemonldap::NG). In Seafile 12, everything is working, but if I upgrade to 13.0.12, I don’t have the “single sign on” button on the login page. In seahub_settings, I have this

ENABLE_OAUTH = True
OAUTH_CREATE_UNKNOWN_USER = True
OAUTH_ACTIVATE_USER_AFTER_CREATION = True
OAUTH_CLIENT_ID = "seafile"
OAUTH_CLIENT_SECRET = "XXXXX"
OAUTH_REDIRECT_URL = "https://seafile.poc.local/oauth/callback/"
OAUTH_PROVIDER_DOMAIN = "poc.local"
OAUTH_PROVIDER = "ehtrace.com"
OAUTH_AUTHORIZATION_URL = "https://sso.poc.local/oauth2/authorize"
OAUTH_TOKEN_URL = "https://sso.poc.local/oauth2/token"
OAUTH_USER_INFO_URL = "https://sso.poc.local/oauth2/userinfo"
OAUTH_SCOPE = ["openid", "profile", "email"]
OAUTH_ATTRIBUTE_MAP = {
    "email": (True, "contact_email"),
    "id": (True, "id"),
    "name": (True, "name"),
    "principal": (True, "uid"),
}

Anything changed regarding oauth support in Seafile 13 ? Can’t find anything relevant in the docs

Hello, the enable_sso variable controls whether the “single sign on” button is displayed.

Could you add a line of debugging code in seafile-server-latest/seahub/seahub/auth/views.py according to the following github commit


logger.error(enable_sso)

After adding it, restart Seafile, and then check what the output in seahub.log is.

I checked with the official docker-compose stack, and everything is working. Must be something specific to my install (I had to do quite a lot of customizations to the images and the deployment to run on Nomad). Seahub just wasn’t finding my seahub_settings.py file. Not sure how it’s done in the official stack, but I added /opt/seafile/conf to PYTHONPATH and now everything is working. Thanks for the help.