Esempio n. 1
0
def get_grants(ini, user_id, client_id, audience, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(
        client.get_all_grants(user_id=user_id,
                              client_id=client_id,
                              audience=audience))
Esempio n. 2
0
def get_a_client_application(ini, client_id, fields, include_fields, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(
        client.get_a_client_application(id=client_id,
                                        fields=fields,
                                        include_fields=include_fields))
Esempio n. 3
0
def get_all_blacklisted_tokens(
        ini,
        debug
    ):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_blacklist())
Esempio n. 4
0
def get_tenant_settings(
        ini,
        debug
    ):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_tenants())
Esempio n. 5
0
def update_tenant_settings(
        ini,
        body,
        debug
    ):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.update_tenant_settings(body=body))
Esempio n. 6
0
def get_rule_by_id(ini, rule_id, fields, include_fields, debug):

    field = fields.split.split(',')
    client = Auth0Client(get_config_dict(ini, debug))
    print(
        client.get_rule_by_id(id=rule_id,
                              fields=fields,
                              include_fields=include_fields))
Esempio n. 7
0
def create_job_to_import_users(ini, users_file_path, connection_id, upsert,
                               external_id, send_completion_email, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(
        client.create_job_to_import_users(connection_id=connection_id,
                                          file_obj=users_file_path,
                                          upsert=upsert))
Esempio n. 8
0
def blacklist_a_token(
        ini,
        jwt_audit_claim,
        jti,
        debug
    ):

    body = {}
    body['aud'] = jwt_audit_claim
    body['jti'] = jti
    body = json.loads(data)
    client = Auth0Client(get_config_dict(ini, debug))
    print(client.blacklist_a_token(body=body))
Esempio n. 9
0
def create_an_email_verification_ticket(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.create_an_email_verification_ticket(body=body))
Esempio n. 10
0
def create_a_rule(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_all_rules())
Esempio n. 11
0
def get_all_rules(ini, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_all_rules())
Esempio n. 12
0
def update_rule(ini, rule_id, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.update_rule(id=rule_id, body=body))
Esempio n. 13
0
def unblock_a_user(ini, user_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.unblock_a_user(user_id))
Esempio n. 14
0
def get_a_users_blocks(ini, user_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.list_user_blocks(user_id))
Esempio n. 15
0
def delete_custom_domain_configuration(ini, domain_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.delete_custom_domain(id=domain_id))
Esempio n. 16
0
def delete_rule(ini, rule_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.delete_rule(id=rule_id))
Esempio n. 17
0
def create_job_to_export_users(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.create_job_to_export_users(job_id))
Esempio n. 18
0
def get_all_client_applications(ini, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_all_client_applications())
Esempio n. 19
0
def update_a_client_application(ini, application_id, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.update_a_client_application(id=application_id, body=body))
Esempio n. 20
0
def dump_account_details(ini, debug):

    # Get client
    client = Auth0Client(get_config_dict(ini, debug))

    # Get all clients applications
    print("\n#######################")
    print('Client Applications')
    print("#########################")

    client_data = client.get_all_client_applications()

    # Clean the json
    #client_data = client_data.replace('"utf-8"','\"utf-8\"').replace('"X-UA-Compatible"','\"X-UA-Compatible\"')

    print(client_data)

    if debug:
        print('trying to load client data' + lineno())
    #client_data = json.loads(client_data[0])

    if debug:
        print('done loading client data: ' + lineno())

    client_ids = {}
    for client_info in client_data:
        if 'client_id' in client_info:
            temp = {}
            temp['client_id'] = client_info['client_id']
            temp['name'] = client_info['name']
            client_ids[client_info['client_id']] = client_info['name']

    print('client ids:')
    print(pretty(client_ids))

    input("\n\nPress Enter To Continue\n")

    # Get all users
    print("\n#######################")
    print('Users')
    print("#########################")

    user_data = client.list_users()
    #print(user_data)
    user_data = json.loads(user_data)

    user_ids = []

    for user in user_data:
        print('user: '******'user_id' in user and 'email' in user:
            user_ids.append(user['user_id'])
            print('###################')
            print('id: ' + str(user['user_id']))
            print('email:' + str(user['email']))
            print('###################')

            print("\n\t#######################")
            print("\t" + 'Guardian Enrollments')
            print("\t#########################")

            guardian_enrollment_data = client.get_list_of_guardian_enrollments(
                user_id=user['user_id'])
            print(guardian_enrollment_data)

            print("\n\t#######################")
            print("\t" + 'User Blocks')
            print("\t#########################")

            user_blocks_data = client.list_user_blocks(user_id=user['user_id'])
            print(user_blocks_data)

            print("\n\t#######################")
            print("\t" + 'User Logs')
            print("\t#########################")

            user_logs_data = client.get_user_log_events(
                user_id=user['user_id'])
            print(user_logs_data)

    input("\n\nPress Enter To Continue\n")

    # Get all rules
    print("\n#######################")
    print('Rules')
    print("#########################")

    rules_data = client.get_all_rules()
    print(rules_data)

    input("\n\nPress Enter To Continue\n")

    # Get all grants
    print("\n#######################")
    print('Grants')
    print("#########################")

    grants_data = client.get_client_grants()
    print(grants_data)

    grants_data = json.loads(grants_data)
    grant_ids = {}
    for grants_info in grants_data:
        if 'client_id' in grants_info and 'audience' in grants_info:
            temp = {}
            temp['client_id'] = grants_info['client_id']
            temp['audience'] = grants_info['audience']
            grant_ids[grants_info['id']] = []
            grant_ids[grants_info['id']].append(temp)

    print("\n###### Grant Ids #########")
    print(pretty(grant_ids))

    input("\n\nPress Enter To Continue\n")

    # Get more grants

    for id in grant_ids:
        print(grant_ids[id])

        for user in user_ids:

            print('user: '******'client_id'],
                audience=grant_ids[id][0]['audience'])
            print(user_grants)

    input("\n\nPress Enter To Continue\n")

    # Get all connections
    print("\n#######################")
    print('Connections')
    print("#########################")

    connection_data = client.get_all_connections()
    print(connection_data)

    input("\n\nPress Enter To Continue\n")

    # Get all Guardian Factors
    print("\n#######################")
    print('Guardian Factors')
    print("#########################")

    factor_data = client.list_factors()
    print(factor_data)

    input("\n\nPress Enter To Continue\n")

    # Get all Guardian Enrollment Templates
    print("\n#######################")
    print('Guardian Enrollment Templates')
    print("#########################")

    template_data = client.list_enrollment_templates()
    print(template_data)

    input("\n\nPress Enter To Continue\n")

    # Get all Guardian SNS Factor Provider Config
    print("\n#######################")
    print('Guardian SNS Factor Provider Config')
    print("#########################")

    sns_factor_config_data = client.list_sns_factor_provider_config()
    print(sns_factor_config_data)

    input("\n\nPress Enter To Continue\n")

    # Get all Guardian Twilio Factor Provider Config
    print("\n#######################")
    print('Guardian Twilio Factor Provider Config')
    print("#########################")

    twilio_factor_config_data = client.list_twilio_factor_provider_config()
    print(twilio_factor_config_data)

    input("\n\nPress Enter To Continue\n")

    # Get all Resource Servers
    print("\n#######################")
    print('Resource Servers')
    print("#########################")

    resource_data = client.get_all_resource_servers()
    print(resource_data)

    input("\n\nPress Enter To Continue\n")

    # Daily Stats
    print("\n#######################")
    print('Daily Stats')
    print("#########################")

    stats_data = client.daily_stats(2)
    print(stats_data)

    input("\n\nPress Enter To Continue\n")

    # Tenants
    print("\n#######################")
    print('Tenants')
    print("#########################")

    tenants_data = client.get_tenants()
    print(tenants_data)
Esempio n. 21
0
def get_daily_stats(ini, past_number_of_days, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.daily_stats(days=past_number_of_days))
Esempio n. 22
0
def get_active_users_count(ini, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.active_users())
Esempio n. 23
0
def search_users_by_email(ini, email, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.user_by_email(email=email))
Esempio n. 24
0
def get_custom_domain_configurations(ini, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.get_custom_domains())
Esempio n. 25
0
def create_a_password_change_ticket(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.create_a_password_change_ticket(body=body))
Esempio n. 26
0
def create_a_client_application(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.create_a_client_application(body=body))
Esempio n. 27
0
def configure_new_custom_domain(ini, body, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.create_new_custom_domain(body=body))
Esempio n. 28
0
def delete_a_client_application(ini, application_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.delete_a_client_application(id=application_id))
Esempio n. 29
0
def verify_a_custom_domain(ini, domain_id, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.verify_custom_domain(id=domain_id))
Esempio n. 30
0
def unblock_by_identifier(ini, identifier, debug):

    client = Auth0Client(get_config_dict(ini, debug))
    print(client.unblock_by_identifier(identifier))