duosecurity/duo_client_python

Getting access to "voice_enabled" attribute

geracastro opened this issue · 3 comments

I need to get a list of all users who have DUO set send them a Phone Call. I see that there's a modify_group() method where "voice_enabled" is a boolean that can be called; but that's just to change the method to Phone Call, correct? How can I get a list of users where that attribute is True? When I download all users' JSON I don't see that attribute available. Even if I call a user by name, the optional attribute of "voice_enabled" is not available. What am I missing?

@thetechuser As you noted, 'voice_enabled' is an attribute of a group, not a user - so it won't be provided in the user info. It will be returned in the group info per https://duo.com/docs/adminapi#get-group-info.

I think what you'd need to do is find the groups with voice_enabled of True, then for each of these groups, fetch the list of users in that group? If so, note that you can do so from the '/admin/v2/groups/[group_id]/users' API endpoint which is described a little bit further down the page. I believe the 'get_group_users()' method in admin.py should be of use to you for this.

@thetechuser As you noted, 'voice_enabled' is an attribute of a group, not a user - so it won't be provided in the user info. It will be returned in the group info per https://duo.com/docs/adminapi#get-group-info.

I think what you'd need to do is find the groups with voice_enabled of True, then for each of these groups, fetch the list of users in that group? If so, note that you can do so from the '/admin/v2/groups/[group_id]/users' API endpoint which is described a little bit further down the page. I believe the 'get_group_users()' method in admin.py should be of use to you for this.

Great! Thank you @AaronAtDuo - I will look into it.

Ended up doing it manually. Downloaded a CSV file with the users from DUO. Thanks.