November 23, 2017

Toggle Security Questions

Shows how to Enable or Disable security questions on a user account
Disable require security questions on log in.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>

import SoftLayer
import json

userName = "myusernaetest0235"

client = SoftLayer.Client()
accountService = client['SoftLayer_Account']
userService = client['SoftLayer_User_Customer']

objectFilterUser = {"users": {"username": {"operation": userName}}}

    users = accountService.getUsers(filter=objectFilterUser)
    # users[0]['secondaryLoginRequiredFlag'] = False
    # ENABLE
    users[0]['secondaryLoginRequiredFlag'] = True
    result = userService.editObject(users[0], id=users[0]['id'])
    print(json.dumps(result, sort_keys=True, indent=2, separators=(',', ': ')))

except SoftLayer.SoftLayerAPIError as e:
    print("Unable to disable require security questions on log in. faultCode=%s, faultString=%s" % (e.faultCode, e.faultString))


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue