Skip to content

Housain-maina/py-logto

Repository files navigation

py-logto

Python Client for Logto API.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.17.0:edge
  • Package version: 1.0.1
  • Generator version: 7.7.0

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/Housain-maina/py-logto.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/Housain-maina/py-logto.git)

Then import the package:

import py_logto

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import py_logto

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import py_logto
from py_logto.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3001
# See configuration.py for a list of all supported configuration parameters.
configuration = py_logto.Configuration(
    host = "http://localhost:3001"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): ManagementApi
configuration = py_logto.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with py_logto.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = py_logto.ApplicationsApi(api_client)
    application_id = 'application_id_example' # str | The unique identifier of the application.
    assign_application_roles_request = py_logto.AssignApplicationRolesRequest() # AssignApplicationRolesRequest | 

    try:
        # Assign API resource roles to application
        api_instance.assign_application_roles(application_id, assign_application_roles_request)
    except ApiException as e:
        print("Exception when calling ApplicationsApi->assign_application_roles: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:3001

Class Method HTTP request Description
ApplicationsApi assign_application_roles POST /api/applications/{applicationId}/roles Assign API resource roles to application
ApplicationsApi create_application POST /api/applications Create an application
ApplicationsApi create_application_protected_app_metadata_custom_domain POST /api/applications/{id}/protected-app-metadata/custom-domains Add a custom domain to the protected application.
ApplicationsApi create_application_user_consent_organization POST /api/applications/{id}/users/{userId}/consent-organizations Grant a list of organization access of a user for a application.
ApplicationsApi create_application_user_consent_scope POST /api/applications/{applicationId}/user-consent-scopes Assign user consent scopes to application.
ApplicationsApi delete_application DELETE /api/applications/{id} Delete application
ApplicationsApi delete_application_protected_app_metadata_custom_domain DELETE /api/applications/{id}/protected-app-metadata/custom-domains/{domain} Delete a custom domain.
ApplicationsApi delete_application_role DELETE /api/applications/{applicationId}/roles/{roleId} Remove a API resource role from application
ApplicationsApi delete_application_user_consent_organization DELETE /api/applications/{id}/users/{userId}/consent-organizations/{organizationId} Revoke a user's access to an organization for a application.
ApplicationsApi delete_application_user_consent_scope DELETE /api/applications/{applicationId}/user-consent-scopes/{scopeType}/{scopeId} Remove user consent scope from application.
ApplicationsApi get_application GET /api/applications/{id} Get application
ApplicationsApi get_application_sign_in_experience GET /api/applications/{applicationId}/sign-in-experience Get the application level sign-in experience
ApplicationsApi list_application_organizations GET /api/applications/{id}/organizations Get application organizations
ApplicationsApi list_application_protected_app_metadata_custom_domains GET /api/applications/{id}/protected-app-metadata/custom-domains Get the list of custom domains of the protected application.
ApplicationsApi list_application_roles GET /api/applications/{applicationId}/roles Get application API resource roles
ApplicationsApi list_application_user_consent_organizations GET /api/applications/{id}/users/{userId}/consent-organizations List all the user consented organizations of a application.
ApplicationsApi list_application_user_consent_scopes GET /api/applications/{applicationId}/user-consent-scopes List all the user consent scopes of an application.
ApplicationsApi list_applications GET /api/applications Get applications
ApplicationsApi replace_application_roles PUT /api/applications/{applicationId}/roles Update API resource roles for application
ApplicationsApi replace_application_sign_in_experience PUT /api/applications/{applicationId}/sign-in-experience Update application level sign-in experience
ApplicationsApi replace_application_user_consent_organizations PUT /api/applications/{id}/users/{userId}/consent-organizations Grant a list of organization access of a user for a application.
ApplicationsApi update_application PATCH /api/applications/{id} Update application
AuditLogsApi get_log GET /api/logs/{id} Get log
AuditLogsApi list_logs GET /api/logs Get logs
AuthnApi assert_saml POST /api/authn/saml/{connectorId} SAML ACS endpoint (social)
AuthnApi assert_single_sign_on_saml POST /api/authn/single-sign-on/saml/{connectorId} SAML ACS endpoint (SSO)
AuthnApi get_hasura_auth GET /api/authn/hasura Hasura auth hook endpoint
ConfigsApi delete_jwt_customizer DELETE /api/configs/jwt-customizer/{tokenTypePath} Delete JWT customizer
ConfigsApi delete_oidc_key DELETE /api/configs/oidc/{keyType}/{keyId} Delete OIDC key
ConfigsApi get_admin_console_config GET /api/configs/admin-console Get admin console config
ConfigsApi get_jwt_customizer GET /api/configs/jwt-customizer/{tokenTypePath} Get JWT customizer
ConfigsApi get_oidc_keys GET /api/configs/oidc/{keyType} Get OIDC keys
ConfigsApi list_jwt_customizers GET /api/configs/jwt-customizer Get all JWT customizers
ConfigsApi rotate_oidc_keys POST /api/configs/oidc/{keyType}/rotate Rotate OIDC keys
ConfigsApi test_jwt_customizer POST /api/configs/jwt-customizer/test Test JWT customizer
ConfigsApi update_admin_console_config PATCH /api/configs/admin-console Update admin console config
ConfigsApi update_jwt_customizer PATCH /api/configs/jwt-customizer/{tokenTypePath} Update JWT customizer
ConfigsApi upsert_jwt_customizer PUT /api/configs/jwt-customizer/{tokenTypePath} Create or update JWT customizer
ConnectorFactoriesApi get_connector_factory GET /api/connector-factories/{id} Get connector factory
ConnectorFactoriesApi list_connector_factories GET /api/connector-factories Get connector factories
ConnectorsApi create_connector POST /api/connectors Create connector
ConnectorsApi create_connector_authorization_uri POST /api/connectors/{connectorId}/authorization-uri Get connector's authorization URI
ConnectorsApi create_connector_test POST /api/connectors/{factoryId}/test Test passwordless connector
ConnectorsApi delete_connector DELETE /api/connectors/{id} Delete connector
ConnectorsApi get_connector GET /api/connectors/{id} Get connector
ConnectorsApi list_connectors GET /api/connectors Get connectors
ConnectorsApi update_connector PATCH /api/connectors/{id} Update connector
CustomPhrasesApi delete_custom_phrase DELETE /api/custom-phrases/{languageTag} Delete custom phrase
CustomPhrasesApi get_custom_phrase GET /api/custom-phrases/{languageTag} Get custom phrases
CustomPhrasesApi list_custom_phrases GET /api/custom-phrases Get all custom phrases
CustomPhrasesApi replace_custom_phrase PUT /api/custom-phrases/{languageTag} Upsert custom phrases
DashboardApi get_active_user_counts GET /api/dashboard/users/active Get active user data
DashboardApi get_new_user_counts GET /api/dashboard/users/new Get new user count
DashboardApi get_total_user_count GET /api/dashboard/users/total Get total user count
DomainsApi create_domain POST /api/domains Create domain
DomainsApi delete_domain DELETE /api/domains/{id} Delete domain
DomainsApi get_domain GET /api/domains/{id} Get domain
DomainsApi list_domains GET /api/domains Get domains
HooksApi create_hook POST /api/hooks Create a hook
HooksApi create_hook_test POST /api/hooks/{id}/test Test hook
HooksApi delete_hook DELETE /api/hooks/{id} Delete hook
HooksApi get_hook GET /api/hooks/{id} Get hook
HooksApi list_hook_recent_logs GET /api/hooks/{id}/recent-logs Get recent logs for a hook
HooksApi list_hooks GET /api/hooks Get hooks
HooksApi update_hook PATCH /api/hooks/{id} Update hook
HooksApi update_hook_signing_key PATCH /api/hooks/{id}/signing-key Update signing key for a hook
InteractionApi api_interaction_bind_mfa_post POST /api/interaction/bind-mfa
InteractionApi api_interaction_consent_get GET /api/interaction/consent
InteractionApi api_interaction_consent_post POST /api/interaction/consent
InteractionApi api_interaction_delete DELETE /api/interaction
InteractionApi api_interaction_event_put PUT /api/interaction/event
InteractionApi api_interaction_identifiers_patch PATCH /api/interaction/identifiers
InteractionApi api_interaction_mfa_put PUT /api/interaction/mfa
InteractionApi api_interaction_mfa_skipped_put PUT /api/interaction/mfa-skipped
InteractionApi api_interaction_profile_delete DELETE /api/interaction/profile
InteractionApi api_interaction_profile_patch PATCH /api/interaction/profile
InteractionApi api_interaction_profile_put PUT /api/interaction/profile
InteractionApi api_interaction_put PUT /api/interaction
InteractionApi api_interaction_single_sign_on_connector_id_authentication_post POST /api/interaction/single-sign-on/{connectorId}/authentication
InteractionApi api_interaction_single_sign_on_connector_id_authorization_url_post POST /api/interaction/single-sign-on/{connectorId}/authorization-url
InteractionApi api_interaction_single_sign_on_connector_id_registration_post POST /api/interaction/single-sign-on/{connectorId}/registration
InteractionApi api_interaction_single_sign_on_connectors_get GET /api/interaction/single-sign-on/connectors
InteractionApi api_interaction_submit_post POST /api/interaction/submit
InteractionApi api_interaction_verification_social_authorization_uri_post POST /api/interaction/verification/social-authorization-uri
InteractionApi api_interaction_verification_totp_post POST /api/interaction/verification/totp
InteractionApi api_interaction_verification_verification_code_post POST /api/interaction/verification/verification-code
InteractionApi api_interaction_verification_webauthn_authentication_post POST /api/interaction/verification/webauthn-authentication
InteractionApi api_interaction_verification_webauthn_registration_post POST /api/interaction/verification/webauthn-registration
OrganizationInvitationsApi create_organization_invitation POST /api/organization-invitations Create organization invitation
OrganizationInvitationsApi create_organization_invitation_message POST /api/organization-invitations/{id}/message Resend invitation message
OrganizationInvitationsApi delete_organization_invitation DELETE /api/organization-invitations/{id} Delete organization invitation
OrganizationInvitationsApi get_organization_invitation GET /api/organization-invitations/{id} Get organization invitation
OrganizationInvitationsApi list_organization_invitations GET /api/organization-invitations Get organization invitations
OrganizationInvitationsApi replace_organization_invitation_status PUT /api/organization-invitations/{id}/status Update organization invitation status
OrganizationRolesApi create_organization_role POST /api/organization-roles Create an organization role
OrganizationRolesApi create_organization_role_resource_scope POST /api/organization-roles/{id}/resource-scopes Assign resource scopes to organization role
OrganizationRolesApi create_organization_role_scope POST /api/organization-roles/{id}/scopes Assign organization scopes to organization role
OrganizationRolesApi delete_organization_role DELETE /api/organization-roles/{id} Delete organization role
OrganizationRolesApi delete_organization_role_resource_scope DELETE /api/organization-roles/{id}/resource-scopes/{scopeId} Remove resource scope
OrganizationRolesApi delete_organization_role_scope DELETE /api/organization-roles/{id}/scopes/{organizationScopeId} Remove organization scope
OrganizationRolesApi get_organization_role GET /api/organization-roles/{id} Get organization role
OrganizationRolesApi list_organization_role_resource_scopes GET /api/organization-roles/{id}/resource-scopes Get organization role resource scopes
OrganizationRolesApi list_organization_role_scopes GET /api/organization-roles/{id}/scopes Get organization role scopes
OrganizationRolesApi list_organization_roles GET /api/organization-roles Get organization roles
OrganizationRolesApi replace_organization_role_resource_scopes PUT /api/organization-roles/{id}/resource-scopes Replace resource scopes for organization role
OrganizationRolesApi replace_organization_role_scopes PUT /api/organization-roles/{id}/scopes Replace organization scopes for organization role
OrganizationRolesApi update_organization_role PATCH /api/organization-roles/{id} Update organization role
OrganizationScopesApi create_organization_scope POST /api/organization-scopes Create an organization scope
OrganizationScopesApi delete_organization_scope DELETE /api/organization-scopes/{id} Delete organization scope
OrganizationScopesApi get_organization_scope GET /api/organization-scopes/{id} Get organization scope
OrganizationScopesApi list_organization_scopes GET /api/organization-scopes Get organization scopes
OrganizationScopesApi update_organization_scope PATCH /api/organization-scopes/{id} Update organization scope
OrganizationsApi add_organization_applications POST /api/organizations/{id}/applications Add organization application
OrganizationsApi add_organization_users POST /api/organizations/{id}/users Add user members to organization
OrganizationsApi assign_organization_roles_to_application POST /api/organizations/{id}/applications/{applicationId}/roles Add organization application role
OrganizationsApi assign_organization_roles_to_applications POST /api/organizations/{id}/applications/roles Assign roles to applications in an organization
OrganizationsApi assign_organization_roles_to_user POST /api/organizations/{id}/users/{userId}/roles Assign roles to a user in an organization
OrganizationsApi assign_organization_roles_to_users POST /api/organizations/{id}/users/roles Assign roles to organization user members
OrganizationsApi create_organization POST /api/organizations Create an organization
OrganizationsApi create_organization_jit_email_domain POST /api/organizations/{id}/jit/email-domains Add organization JIT email domain
OrganizationsApi create_organization_jit_role POST /api/organizations/{id}/jit/roles Add organization JIT default roles
OrganizationsApi create_organization_jit_sso_connector POST /api/organizations/{id}/jit/sso-connectors Add organization JIT SSO connectors
OrganizationsApi delete_organization DELETE /api/organizations/{id} Delete organization
OrganizationsApi delete_organization_application DELETE /api/organizations/{id}/applications/{applicationId} Remove organization application
OrganizationsApi delete_organization_application_role DELETE /api/organizations/{id}/applications/{applicationId}/roles/{organizationRoleId} Remove organization application role
OrganizationsApi delete_organization_jit_email_domain DELETE /api/organizations/{id}/jit/email-domains/{emailDomain} Remove organization JIT email domain
OrganizationsApi delete_organization_jit_role DELETE /api/organizations/{id}/jit/roles/{organizationRoleId} Remove organization JIT default role
OrganizationsApi delete_organization_jit_sso_connector DELETE /api/organizations/{id}/jit/sso-connectors/{ssoConnectorId} Remove organization JIT SSO connector
OrganizationsApi delete_organization_user DELETE /api/organizations/{id}/users/{userId} Remove user member from organization
OrganizationsApi delete_organization_user_role DELETE /api/organizations/{id}/users/{userId}/roles/{organizationRoleId} Remove a role from a user in an organization
OrganizationsApi get_organization GET /api/organizations/{id} Get organization
OrganizationsApi list_organization_application_roles GET /api/organizations/{id}/applications/{applicationId}/roles Get organization application roles
OrganizationsApi list_organization_applications GET /api/organizations/{id}/applications Get organization applications
OrganizationsApi list_organization_jit_email_domains GET /api/organizations/{id}/jit/email-domains Get organization JIT email domains
OrganizationsApi list_organization_jit_roles GET /api/organizations/{id}/jit/roles Get organization JIT default roles
OrganizationsApi list_organization_jit_sso_connectors GET /api/organizations/{id}/jit/sso-connectors Get organization JIT SSO connectors
OrganizationsApi list_organization_user_roles GET /api/organizations/{id}/users/{userId}/roles Get roles for a user in an organization
OrganizationsApi list_organization_user_scopes GET /api/organizations/{id}/users/{userId}/scopes Get scopes for a user in an organization tailored by the organization roles
OrganizationsApi list_organization_users GET /api/organizations/{id}/users Get organization user members
OrganizationsApi list_organizations GET /api/organizations Get organizations
OrganizationsApi replace_organization_application_roles PUT /api/organizations/{id}/applications/{applicationId}/roles Replace organization application roles
OrganizationsApi replace_organization_applications PUT /api/organizations/{id}/applications Replace organization applications
OrganizationsApi replace_organization_jit_email_domains PUT /api/organizations/{id}/jit/email-domains Replace organization JIT email domains
OrganizationsApi replace_organization_jit_roles PUT /api/organizations/{id}/jit/roles Replace organization JIT default roles
OrganizationsApi replace_organization_jit_sso_connectors PUT /api/organizations/{id}/jit/sso-connectors Replace organization JIT SSO connectors
OrganizationsApi replace_organization_user_roles PUT /api/organizations/{id}/users/{userId}/roles Update roles for a user in an organization
OrganizationsApi replace_organization_users PUT /api/organizations/{id}/users Replace organization user members
OrganizationsApi update_organization PATCH /api/organizations/{id} Update organization
ResourcesApi create_resource POST /api/resources Create an API resource
ResourcesApi create_resource_scope POST /api/resources/{resourceId}/scopes Create API resource scope
ResourcesApi delete_resource DELETE /api/resources/{id} Delete API resource
ResourcesApi delete_resource_scope DELETE /api/resources/{resourceId}/scopes/{scopeId} Delete API resource scope
ResourcesApi get_resource GET /api/resources/{id} Get API resource
ResourcesApi list_resource_scopes GET /api/resources/{resourceId}/scopes Get API resource scopes
ResourcesApi list_resources GET /api/resources Get API resources
ResourcesApi update_resource PATCH /api/resources/{id} Update API resource
ResourcesApi update_resource_is_default PATCH /api/resources/{id}/is-default Set API resource as default
ResourcesApi update_resource_scope PATCH /api/resources/{resourceId}/scopes/{scopeId} Update API resource scope
RolesApi create_role POST /api/roles Create a role
RolesApi create_role_application POST /api/roles/{id}/applications Assign role to applications
RolesApi create_role_scope POST /api/roles/{id}/scopes Link scopes to role
RolesApi create_role_user POST /api/roles/{id}/users Assign role to users
RolesApi delete_role DELETE /api/roles/{id} Delete role
RolesApi delete_role_application DELETE /api/roles/{id}/applications/{applicationId} Remove role from application
RolesApi delete_role_scope DELETE /api/roles/{id}/scopes/{scopeId} Unlink scope from role
RolesApi delete_role_user DELETE /api/roles/{id}/users/{userId} Remove role from user
RolesApi get_role GET /api/roles/{id} Get role
RolesApi list_role_applications GET /api/roles/{id}/applications Get role applications
RolesApi list_role_scopes GET /api/roles/{id}/scopes Get role scopes
RolesApi list_role_users GET /api/roles/{id}/users Get role users
RolesApi list_roles GET /api/roles Get roles
RolesApi update_role PATCH /api/roles/{id} Update role
SSOConnectorProvidersApi list_sso_connector_providers GET /api/sso-connector-providers List all the supported SSO connector provider details
SSOConnectorsApi create_sso_connector POST /api/sso-connectors Create SSO connector
SSOConnectorsApi delete_sso_connector DELETE /api/sso-connectors/{id} Delete SSO connector
SSOConnectorsApi get_sso_connector GET /api/sso-connectors/{id} Get SSO connector
SSOConnectorsApi list_sso_connectors GET /api/sso-connectors List SSO connectors
SSOConnectorsApi update_sso_connector PATCH /api/sso-connectors/{id} Update SSO connector
SignInExperienceApi get_sign_in_exp GET /api/sign-in-exp Get default sign-in experience settings
SignInExperienceApi update_sign_in_exp PATCH /api/sign-in-exp Update default sign-in experience settings
StatusApi get_status GET /api/status Health check
SwaggerJsonApi get_swagger_json GET /api/swagger.json Get Swagger JSON
SystemsApi get_system_application_config GET /api/systems/application Get the application constants.
UserAssetsApi create_user_asset POST /api/user-assets Upload asset
UserAssetsApi get_user_asset_service_status GET /api/user-assets/service-status Get service status
UsersApi assign_user_roles POST /api/users/{userId}/roles Assign roles to user
UsersApi create_user POST /api/users Create user
UsersApi create_user_identity POST /api/users/{userId}/identities Link social identity to user
UsersApi create_user_mfa_verification POST /api/users/{userId}/mfa-verifications Create an MFA verification for a user
UsersApi delete_user DELETE /api/users/{userId} Delete user
UsersApi delete_user_identity DELETE /api/users/{userId}/identities/{target} Delete social identity from user
UsersApi delete_user_mfa_verification DELETE /api/users/{userId}/mfa-verifications/{verificationId} Delete an MFA verification for a user
UsersApi delete_user_role DELETE /api/users/{userId}/roles/{roleId} Remove role from user
UsersApi get_user GET /api/users/{userId} Get user
UsersApi get_user_has_password GET /api/users/{userId}/has-password Check if user has password
UsersApi list_user_custom_data GET /api/users/{userId}/custom-data Get user custom data
UsersApi list_user_mfa_verifications GET /api/users/{userId}/mfa-verifications Get user's MFA verifications
UsersApi list_user_organizations GET /api/users/{userId}/organizations Get organizations for a user
UsersApi list_user_roles GET /api/users/{userId}/roles Get roles for user
UsersApi list_users GET /api/users Get users
UsersApi replace_user_identity PUT /api/users/{userId}/identities/{target} Update social identity of user
UsersApi replace_user_roles PUT /api/users/{userId}/roles Update roles for user
UsersApi update_user PATCH /api/users/{userId} Update user
UsersApi update_user_custom_data PATCH /api/users/{userId}/custom-data Update user custom data
UsersApi update_user_is_suspended PATCH /api/users/{userId}/is-suspended Update user suspension status
UsersApi update_user_password PATCH /api/users/{userId}/password Update user password
UsersApi update_user_profile PATCH /api/users/{userId}/profile Update user profile
UsersApi verify_user_password POST /api/users/{userId}/password/verify Verify user password
VerificationCodesApi create_verification_code POST /api/verification-codes Request and send a verification code
VerificationCodesApi verify_verification_code POST /api/verification-codes/verify Verify a verification code
WellKnownApi get_sign_in_experience_config GET /api/.well-known/sign-in-exp Get full sign-in experience
WellKnownApi get_sign_in_experience_phrases GET /api/.well-known/phrases Get localized phrases

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ManagementApi

  • Type: Bearer authentication (JWT)

Author