oktalib package¶
Subpackages¶
- oktalib.entities package
- Submodules
- oktalib.entities.core module
- oktalib.entities.entities module
AdminRoleApplicationApplication.accessibilityApplication.activate()Application.add_group_by_id()Application.add_group_by_name()Application.assign_group_to_saml_user_roles()Application.credentialsApplication.deactivate()Application.featuresApplication.get_associated_saml_roles()Application.get_group_assignment_by_group_name()Application.get_user_assignment_by_email()Application.group_assignmentsApplication.groupsApplication.labelApplication.nameApplication.notification_settingsApplication.remove_group_by_id()Application.remove_group_by_name()Application.settingsApplication.sign_on_modeApplication.sign_on_settingsApplication.statusApplication.urlApplication.user_assignmentsApplication.usersApplication.visibility
GroupGroup.add_to_application_with_label()Group.add_user_by_id()Group.add_user_by_login()Group.applicationsGroup.delete()Group.descriptionGroup.last_membership_updated_atGroup.nameGroup.object_classesGroup.profileGroup.remove_from_application_with_label()Group.remove_user_by_id()Group.remove_user_by_login()Group.typeGroup.urlGroup.users
GroupAssignmentUserUser.activate()User.activated_atUser.cityUser.contry_codeUser.credentialsUser.deactivate()User.delete()User.departmentUser.display_nameUser.emailUser.employee_numberUser.expire_password()User.first_nameUser.groupsUser.last_login_atUser.last_nameUser.localeUser.loginUser.managerUser.mobile_phoneUser.organizationUser.password_changed_atUser.primary_phoneUser.reset_password()User.rolesUser.second_emailUser.set_password()User.set_temporary_password()User.statusUser.status_changed_atUser.street_addressUser.suspend()User.titleUser.unlock()User.unsuspend()User.update_password()User.update_profile()User.update_security_question()User.urlUser.zip_code
UserAssignment
- Module contents
Submodules¶
oktalib.oktalib module¶
Main code for oktalib.
- class oktalib.oktalib.Okta(host, token)[source]¶
Bases:
objectModels the api of okta.
- property applications¶
The applications configured in okta.
- Returns:
The generator of applications configured in okta
- Return type:
generator
- assign_group_to_application(application_label, group_name)[source]¶
Assigns a group to an application.
- Parameters:
application_label – The label of the application to assign the group to
group_name – The group name to assign to the application
- Returns:
True on success, False otherwise
- assign_role_to_user_by_id(user_id, role_name)[source]¶
Assigns an admin role to a user by id.
- Parameters:
user_id – The user ID to match the user with
role_name – The name of the role to assign
- Returns:
The response, None otherwise
- Return type:
- create_group(name, description)[source]¶
Creates a group in okta.
- Parameters:
name – The name of the group to create
description – The description of the group to create
- Returns:
The created group object on success, None otherwise
- create_user(first_name, last_name, email, login, password=None, enabled=True)[source]¶
Creates a user in okta.
- Parameters:
first_name – The first name of the user
last_name – The last name of the user
email – The email of the user
login – The login of the user
password – The password of the user
enabled – A flag whether the user should be enabled or not Defaults to True
- Returns:
The created user on success, None otherwise
- Return type:
- delete_group(name)[source]¶
Deletes a group from okta.
- Parameters:
name – The name of the group to delete
- Returns:
True on success, False otherwise
- Return type:
bool
- Raises:
InvalidGroup – The group provided as argument does not exist.
- get_application_by_id(id_)[source]¶
Retrieves an application by id.
- Parameters:
id – The id of the application to retrieve
- Returns:
Application Object
- get_application_by_label(label)[source]¶
Retrieves an application by label.
- Parameters:
label – The label of the application to retrieve
- Returns:
Application Object
- get_group_by_id(group_id)[source]¶
Retrieves the group (of any type) by id.
- Parameters:
group_id – The id of the group to retrieve
- Returns:
The group if a match is found else None
- Return type:
- get_group_by_name(name)[source]¶
Retrieves the first group (of any type) by name.
- Parameters:
name – The name of the group to retrieve
- Returns:
The group if a match is found else None
- Return type:
- get_group_type_by_name(name, group_type='OKTA_GROUP')[source]¶
Retrieves the group type of okta by name.
- Parameters:
group_type – The type of okta group to retrieve
name – The name of the group to retrieve
- Returns:
The group if a match is found else None
- Return type:
- get_user_assigned_roles_by_id(user_id)[source]¶
Retrieves if any, admin roles assigned to the user by id.
- Parameters:
id – The user ID to match the user with
- Returns:
A list of the user’s roles if found, None otherwise
- Return type:
list
- get_user_by_login(login)[source]¶
Retrieves a user by login.
- Parameters:
login – The login to match the user with
- Returns:
The user if found, None otherwise
- Return type:
- property groups¶
The groups configured in okta.
- Returns:
The generator of groups configured in okta
- Return type:
generator
- remove_group_from_application(application_label, group_name)[source]¶
Removes a group from an application.
- Parameters:
application_label – The label of the application to remove the group from
group_name – The name of the group to remove from the application
- Returns:
True on success, False otherwise
- remove_role_from_user_by_id(user_id, role_id)[source]¶
Remove an admin role from a user by id.
- Parameters:
user_id – The user ID to match the user with
role_id – The id of the role to remove
- Returns:
The response, None otherwise
- Return type:
- search_groups_by_name(name)[source]¶
Retrieves the groups (of any type) by name.
- Parameters:
name – The name of the groups to retrieve
- Returns:
A list of groups if a match is found else an empty list
- Return type:
list
- search_users(value)[source]¶
Retrieves a list of users by looking into name, last name and email.
- Parameters:
value – The value to match with
- Returns:
The users if found, empty list otherwise
- Return type:
list
- search_users_by_email(email)[source]¶
Retrieves a list of users by email.
- Parameters:
email – The email to match the user with
- Returns:
The users if found, empty list otherwise
- Return type:
list
- property users¶
The users configured in okta.
- Returns:
The generator of users configured in okta
- Return type:
generator
oktalib.oktalibexceptions module¶
Custom exception code for oktalib.
- exception oktalib.oktalibexceptions.ApiLimitReached[source]¶
Bases:
ExceptionThe api limits are close to being reached.
- exception oktalib.oktalibexceptions.AuthFailed[source]¶
Bases:
ExceptionThe authentication was not possible. Invalid token maybe.
- exception oktalib.oktalibexceptions.InvalidApplication[source]¶
Bases:
ExceptionThe application provided is invalid.
- exception oktalib.oktalibexceptions.InvalidGroup[source]¶
Bases:
ExceptionThe group provided is invalid.
- exception oktalib.oktalibexceptions.InvalidUser[source]¶
Bases:
ExceptionThe user provided is invalid.
Module contents¶
oktalib package.
Import all parts from oktalib here