oktalib package¶
Subpackages¶
- oktalib.entities package
- Submodules
- oktalib.entities.core module
- oktalib.entities.entities module
AdminRole
Application
Application.accessibility
Application.activate()
Application.add_group_by_id()
Application.add_group_by_name()
Application.assign_group_to_saml_user_roles()
Application.credentials
Application.deactivate()
Application.features
Application.get_associated_saml_roles()
Application.get_group_assignment_by_group_name()
Application.get_user_assignment_by_email()
Application.group_assignments
Application.groups
Application.label
Application.name
Application.notification_settings
Application.remove_group_by_id()
Application.remove_group_by_name()
Application.settings
Application.sign_on_mode
Application.sign_on_settings
Application.status
Application.url
Application.user_assignments
Application.users
Application.visibility
Group
Group.add_to_application_with_label()
Group.add_user_by_id()
Group.add_user_by_login()
Group.applications
Group.delete()
Group.description
Group.last_membership_updated_at
Group.name
Group.object_classes
Group.profile
Group.remove_from_application_with_label()
Group.remove_user_by_id()
Group.remove_user_by_login()
Group.type
Group.url
Group.users
GroupAssignment
User
User.activate()
User.activated_at
User.city
User.contry_code
User.credentials
User.deactivate()
User.delete()
User.department
User.display_name
User.email
User.employee_number
User.expire_password()
User.first_name
User.groups
User.last_login_at
User.last_name
User.locale
User.login
User.manager
User.mobile_phone
User.organization
User.password_changed_at
User.primary_phone
User.reset_password()
User.roles
User.second_email
User.set_password()
User.set_temporary_password()
User.status
User.status_changed_at
User.street_address
User.suspend()
User.title
User.unlock()
User.unsuspend()
User.update_password()
User.update_profile()
User.update_security_question()
User.url
User.zip_code
UserAssignment
- Module contents
Submodules¶
oktalib.oktalib module¶
Main code for oktalib.
- class oktalib.oktalib.Okta(host, token)[source]¶
Bases:
object
Models 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:
Exception
The api limits are close to being reached.
- exception oktalib.oktalibexceptions.AuthFailed[source]¶
Bases:
Exception
The authentication was not possible. Invalid token maybe.
- exception oktalib.oktalibexceptions.InvalidApplication[source]¶
Bases:
Exception
The application provided is invalid.
- exception oktalib.oktalibexceptions.InvalidGroup[source]¶
Bases:
Exception
The group provided is invalid.
- exception oktalib.oktalibexceptions.InvalidUser[source]¶
Bases:
Exception
The user provided is invalid.
Module contents¶
oktalib package.
Import all parts from oktalib here