After enabling SSO is it possible to disable the password authentication and force SSO?

So I’ve enabled google as my auth provider. I also have LDAP enabled that contains all of the emails that should be allowed to SSO in.

Can I disable the user/pass prompting and force everyone to use SSO now?

2 Likes

I would like the same thing.

Once SSO is live, then disable login and auto SSO redirect.

Dirty hack doing auto redirect:
In file /seafile-server-latest/seahub/seahub/templates/registration/login.html

find:

$(function() {
$(‘#sso’).on(‘click’, function() {
window.location = “{% url ‘sso’ %}{% if next %}?next={{ next|escape }}{% endif %}” + encodeURIComponent(document.location.hash);
return false;
});
});

Replace with:

(function () {
window.location = “{% url ‘sso’ %}{% if next %}?next={{ next|escape }}{% endif %}” + encodeURIComponent(document.location.hash);
return false;
})();

This is a quick and dirty hack and will most likely not survive an update… use at your own risk :slight_smile:

Thanks, I decided I was having to do too many things like this and moved away from Seafile a few months ago. I didn’t want to be dealing with breakage all the time, just pull a new docker container and restart. Too many other things I wanted to work on :slight_smile:

Hi,
Just wanted to see if this is possible with v11?
We enabled sso and would really like to disable the regular login to only allow sso.

Thanks.

I use NGINX as reverse proxy and I was able to disable password login by redirecting the login page to SSO login.

Here is the redirect code:

location  ~ ^(/accounts/login)(.*)$ {
  return 301 /oauth/login$2;
}

Similar redirection can be achieved using any other reverse proxy.