mirror of
https://github.com/skoobasteeve/successfactors-python.git
synced 2026-03-20 03:28:58 +00:00
rename functions for clarity
This commit is contained in:
@@ -42,7 +42,7 @@ from lxml import etree
|
|||||||
from . import templates
|
from . import templates
|
||||||
|
|
||||||
|
|
||||||
def get_access_token(sf_url: str, company_id: str, client_id: str,
|
def request_token(sf_url: str, company_id: str, client_id: str,
|
||||||
assertion: str) -> str:
|
assertion: str) -> str:
|
||||||
"""
|
"""
|
||||||
Send POST request to SuccessFactors containing the generated
|
Send POST request to SuccessFactors containing the generated
|
||||||
@@ -113,7 +113,7 @@ def sign_assertion(xml_string: str, private_key: str) -> str:
|
|||||||
return etree.tostring(root)
|
return etree.tostring(root)
|
||||||
|
|
||||||
|
|
||||||
def auth(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
|
def get_token(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
|
||||||
sf_admin_user: str, sf_saml_private_key: str) -> str:
|
sf_admin_user: str, sf_saml_private_key: str) -> str:
|
||||||
"""
|
"""
|
||||||
Request an API access token by generating a signed SAML assertion
|
Request an API access token by generating a signed SAML assertion
|
||||||
@@ -135,7 +135,7 @@ def auth(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
|
|||||||
signed_assertion_b64 = base64.b64encode(signed_assertion).replace(b'\n', b'')
|
signed_assertion_b64 = base64.b64encode(signed_assertion).replace(b'\n', b'')
|
||||||
|
|
||||||
# Request the API token from SuccessFactors via a POST request
|
# Request the API token from SuccessFactors via a POST request
|
||||||
access_token = get_access_token(sf_url,
|
access_token = request_token(sf_url,
|
||||||
sf_company_id,
|
sf_company_id,
|
||||||
sf_oauth_client_id,
|
sf_oauth_client_id,
|
||||||
signed_assertion_b64)
|
signed_assertion_b64)
|
||||||
|
|||||||
Reference in New Issue
Block a user