How to disable username/password login?

Hi all. Recently I integrated owncloud with keycloak. I have an alternative login button through it. I want to remove the ability to log in using a username and password. How can I do this? What parameter in config.php is responsible for this?

You can try Login Policies
The username + password will always be shown, although you can prevent users from going through there.

There might be additional details in the config.sample.php file (core/config/config.sample.php at master · owncloud/core · GitHub), in the relevant config options.

Note that you need a recent OC version in order to use the login policies.

Can I hide the username and password and leave only the alternative login method?

I don’t think so.
In fact, it could be better to let the admins go through the username + password. If keycloak goes down, at least admins can use ownCloud.

Ok, how i can disable login by username/password?I have default admin and i wont to disable this user

Read through the documentation link. It should explain everything you need. If there is something that isn’t clear enough, feel free to point it out so we can improve the documentation.

1 Like

The documentation contains instructions on how to deny entry to users of a certain group. User admin in group admin. I made the config according to the instructions, but I can still log in as the admin user. What did I do wrong?

  'loginPolicy.order' => '\OC\Authentication\LoginPolicies\GroupLoginPolicy',
  'loginPolicy.groupLoginPolicy.forbidMap' =>
    'password' => 
      'allowOnly' => ['users'],
      'reject' => ['admin'],

The loginPolicy.order must be an array:

'loginPolicy.order' => ['\OC\Authentication\LoginPolicies\GroupLoginPolicy'],

That’s why the policy isn’t being applied and the admin can login.

I tried that too, no result

It should work from OC version 10.12. If you have an earlier version, you’ll have to upgrade first.