Python / SailPoint Package 1.3.2 - Error

Running Windows 11, Python 3.13, sailpoint package 1.3.2.

I am receiving the following error when running my sdk.py file that previously worked before.

Unable to fetch access token. HTTPSConnectionPool(host=xxxxx-dev.api.identitynow.com’, port=443): Max retries exceeded with url: /oauth/token (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Basic Constraints of CA cert not marked critical (_ssl.c:1020)’)))

NOTE: I change for security reason host=xxxxx, instead of our real host name.

import sailpoint
import sailpoint.beta
import sailpoint.v2024
from sailpoint.configuration import Configuration
from sailpoint.paginator import Paginator
from sailpoint.v2024.models.search import Search
from pprint import pprint

configuration = Configuration()
# print(configuration)

# Enter a context with an instance of the API client
with sailpoint.v2024.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sailpoint.v2024.TransformsApi(api_client)

    # List transforms
    # try:
    #     # List transforms
    #     api_response = api_instance.list_transforms()
    #     print("The response of TransformsApi->list_transforms:\n")
    #     for transform in api_response:
    #         pprint(transform.name)
    # except Exception as e:
    #     print("Exception when calling TransformsApi->list_transforms: %s\n" % e)

    # List Access Profiles
    api_instance = sailpoint.v2024.AccessProfilesApi(api_client)

    # try:
    #     api_response = api_instance.list_access_profiles()
    #     print("The response of AccessProfilesApi->list_access_profiles:\n")
    #     for access_profile in api_response:
    #         pprint(access_profile.name)
    # except Exception as e:
    #     print(
    #         "Exception when calling AccessProfilesApi->list_access_profiles: %s\n" % e
    #     )
    
    # Use the paginator with search

    search = Search()
    search.indices = ['identities']
    search.query = { 'query': '*' }
    search.sort = ['-name']
    totalCountIdent = 0
    identities = Paginator.paginate_search(sailpoint.v2024.SearchApi(api_client),search, 1, 1)
    print(search)
    for identity in identities:
        print(identity['name'])
        # print(identity)
        # print()
        # print()
        totalCountIdent = totalCountIdent + 1

    print("Total Identities: " + str(totalCountIdent))
    


    # Use the paginator to paginate 1000 accounts 100 at a time
    # totalCountAcct = 0
    #
    # accounts = Paginator.paginate(sailpoint.v2024.AccountsApi(api_client).list_accounts, 250, limit=250)
    # print(len(accounts))
    # for account in accounts:
    #     print(account.name)
    #     totalCountAcct = totalCountAcct + 1
    #
    # print("Total Accounts: " + str(totalCountAcct))


# with sailpoint.beta.ApiClient(configuration) as api_client:
#
#     workgroups = sailpoint.beta.GovernanceGroupsApi(api_client).list_workgroups()
#     for workgroup in workgroups:
#         print(workgroup.name)

NOTE: I have the SAIL CLI installed and it works fine, so I know that my Client ID/Client Secret is working properly.

Any thoughts or suggestions?

I would start with verifying you tenant url and the personal access tokens are correct in the config.

I have already validated that the tenant url and PAT is correct and functional.

The only thing that has changed from the last time it worked, was updating most of the ‘packages’ to the latest versions (including the sailpoint package).

Update, not sure what it was in my PyCharm setup, but in the Interpreter setting. It gave me an error about not meetings the requirements of sailpoint >= 1.0.0, so I told it to install it (even though list packages showed sailpoint 1.3.2). While it gave an error on the installation of the package, it did allow my code to work again.

I shutdown PyCharm and then restarted it. It still gives me the error that the requirements were not meet, but it still runs my code.

Closing this as a non-issue now.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.