diff --git a/pyproject.toml b/pyproject.toml index 0546fae..55d4187 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "successfactors_auth" -version = "0.0.2" +version = "0.0.3" authors = [ { name="Ray Lyon", email="ray@raylyon.net" }, ] diff --git a/src/successfactors_auth/auth.py b/src/successfactors_auth/auth.py index 0013379..72f7ac4 100644 --- a/src/successfactors_auth/auth.py +++ b/src/successfactors_auth/auth.py @@ -33,9 +33,11 @@ token = sf_auth.auth( import base64 import requests import xmlsec -import importlib.resources from lxml import etree from datetime import datetime, timedelta +from importlib import resources as impresources + +from . import templates # Send POST request to SuccessFactors containing the generated @@ -104,7 +106,7 @@ def sign_assertion(xml_string, private_key): def auth(sf_url, sf_company_id, sf_oauth_client_id, sf_admin_user, sf_saml_private_key): - template_file = "sf_saml_template.xml" + template_file = (impresources.files(templates) / 'sf_saml_template.xml') # Generate SAML assertion XML from template file unsigned_assertion = generate_assertion(sf_url, diff --git a/src/successfactors_auth/sf_saml_template.xml b/src/successfactors_auth/templates/sf_saml_template.xml similarity index 100% rename from src/successfactors_auth/sf_saml_template.xml rename to src/successfactors_auth/templates/sf_saml_template.xml