2FA can now be enabled and disabled via the provisioning api #25876

Merged
merged 1 commit into from Aug 22, 2016

Projects

None yet

2 participants

@DeepDiver1975
Member

@hodyroff

@carlaschroder we need to add this to the provisioning api docs for 9.2 and 9.1

@DeepDiver1975 DeepDiver1975 2FA can now be enabled and disabled via the provisioning api
ed36d60
@DeepDiver1975 DeepDiver1975 added this to the 9.2 milestone Aug 19, 2016
@PVince81
Collaborator

@DeepDiver1975 what's the test command ?
I scrolled through the diff twice and all I see is "Result", "Result", "Result", "Result", ... and one injected two factor provider. Mind pointing to the place where the command was modified ?

@DeepDiver1975
Member

Mind pointing to the place where the command was modified ?

https://github.com/owncloud/core/pull/25876/files#diff-b883261d8003d06c420013ab69dbc6a6R302

@PVince81
Collaborator

Tested:

  1. Enable two factor app
  2. Disable two factor for the admin on the CLI: ./occ twofactorauth:disable admin (else the provisioning API doesn't work, alternative is to create a token)
  3. Create a user "user1"
  4. curl -X PUT --user admin:admin "http://localhost/owncloud/ocs/v1.php/cloud/users/user1" -d key="two_factor_auth_enabled" -d value="false"
  5. Check the user state: curl -X GET --user admin:admin http://localhost/owncloud/ocs/v1.php/cloud/users/user1
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data>
  <enabled>true</enabled>
  <quota/>
  <email/>
  <displayname>user1</displayname>
  <two_factor_auth_enabled></two_factor_auth_enabled>
 </data>
</ocs>

When enabled it shows as 1.

👍 works

@PVince81 PVince81 merged commit e67c564 into master Aug 22, 2016

4 checks passed

Scrutinizer 6 new issues, 1 updated code elements
Details
continuous-integration/jenkins/pr This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
@PVince81 PVince81 deleted the provisioning_2fa branch Aug 22, 2016
@PVince81
Collaborator

@DeepDiver1975 please submit backport PR for 9.1.1

@DeepDiver1975
Member

When enabled it shows as 1.

hmmmm - shouldn't it be a proper true and false?

@PVince81
Collaborator

This is what I saw when getting the user:

  % curl -X GET --user admin:admin http://localhost/owncloud/ocs/v1.php/cloud/users
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data>
  <enabled>true</enabled>
  <quota/>
  <email/>
  <displayname>user1</displayname>
  <two_factor_auth_enabled>1</two_factor_auth_enabled>
 </data>
</ocs>
@PVince81
Collaborator

@DeepDiver1975 please backport and include #25908

@DeepDiver1975 DeepDiver1975 self-assigned this Aug 23, 2016
@DeepDiver1975
Member

@DeepDiver1975 please backport and include #25908

done - #25911

@PVince81 PVince81 referenced this pull request in owncloud/documentation Jan 31, 2017
Open

[dev] document provisioning api call to disable a user #2599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment