Skip to content

occ twofactorauth:state --output is ignored, output is always plain #1209

@r2evans

Description

@r2evans

Steps to reproduce

  1. run php occ twofactorauth:state --output=json username

Expected behaviour

JSON output, perhaps one of the following:

{"backup_codes":"enabled","totp":disabled"]

{"enabled":["backup_codes"],"disabled":["totp"]}
{"enabled":["backup_codes","totp"],"disabled":[]}

Actual behaviour

Two-factor authentication is enabled for user username

Enabled providers:
- backup_codes
- totp

(same output as --output=plain or just no --output=.

Server configuration

Operating system: docker on ubuntu-16

Web server: apache2

Database: postgres

PHP version: 8.1

Version: nextcloud:23.0.3-apache

Updated from an older version or fresh install:

List of activated apps:

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - admin_audit: 1.13.0
  - calendar: 3.2.2
  - circles: 23.1.0
  -   - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contacts: 4.1.0
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_external: 1.15.0
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - impersonate: 1.10.0
  - integration_gitlab: 1.0.3
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - password_policy: 1.13.0
  - photos: 1.5.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - richdocuments: 5.0.3
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - spreed: 13.0.5
  - support: 1.6.0
  - systemtags: 1.13.0
  - text: 3.4.1
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - twofactor_totp: 6.2.0
  - user_ldap: 1.13.1
  - user_status: 1.3.1
  - viewer: 1.7.0
  - weather_status: 1.3.0
  - workflowengine: 2.5.0
Disabled:
  - encryption
  - firstrunwizard: 2.2.1
  - nextcloud_announcements: 1.5.0
  - recommendations: 0.4.0
  - sharebymail: 1.5.0
  - survey_client: 1.3.0
  - twofactor_admin
  - updatenotification: 1.6.0

The content of config/config.php:

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "oc.activedecisionsupport.com"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "23.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwritehost": "oc.activedecisionsupport.com",
        "overwritewebroot": "\/cloud",
        "overwriteprotocol": "https",
        "overwrite.cli.url": "https:\/\/oc.activedecisionsupport.com\/cloud",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "maintenance": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "lost_password_link": "disabled",
        "session_timeout": 129600,
        "session_keepalive": false,
        "remember_login_cookie_lifetime": 604800,
        "simpleSignUpLink.shown": false,
        "default_phone_region": "US",
        "allow_local_remote_servers": true
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions