From 2450ee44d1da146dd2e7f9449afc17ebaa644496 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Wed, 4 Sep 2024 20:23:15 -0700 Subject: [PATCH 1/6] @W-16662200 - fix auth params code refactor --- sfdo_template_helpers/oauth2/salesforce/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfdo_template_helpers/oauth2/salesforce/provider.py b/sfdo_template_helpers/oauth2/salesforce/provider.py index 4b5f369..a13f172 100644 --- a/sfdo_template_helpers/oauth2/salesforce/provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/provider.py @@ -5,7 +5,7 @@ class SFDOSalesforceProvider(SalesforceProvider): package = "sfdo_template_helpers.oauth2.salesforce" def get_auth_params(self, request, action): - ret = super().get_auth_params(request, action) + ret = super().get_auth_params_from_request(request, action) # This will ensure that even if you're logged in to Salesforce, # you'll be prompted to choose an identity to auth as: ret["prompt"] = "login" From fc77d48df0b600df4bf44d356d1b56aa0675c89f Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Wed, 4 Sep 2024 20:24:40 -0700 Subject: [PATCH 2/6] @W-16662200 - version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9a6188a..d8152db 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ name="sfdo-template-helpers", # Required # https://www.python.org/dev/peps/pep-0440/ # https://packaging.python.org/en/latest/single_source_version.html - version="0.23.0", # Required + version="0.24.0", # Required # https://packaging.python.org/specifications/core-metadata/#summary description="A set of Django helpers and utils used by sfdo-template projects.", # https://packaging.python.org/specifications/core-metadata/#description-optional From 745758a51f45215b6e145c8578cc5fdc17ee130b Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Wed, 4 Sep 2024 21:56:52 -0700 Subject: [PATCH 3/6] @W-16662200 - fix auth params code refactor --- sfdo_template_helpers/oauth2/salesforce/provider.py | 2 +- sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sfdo_template_helpers/oauth2/salesforce/provider.py b/sfdo_template_helpers/oauth2/salesforce/provider.py index a13f172..d532168 100644 --- a/sfdo_template_helpers/oauth2/salesforce/provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/provider.py @@ -4,7 +4,7 @@ class SFDOSalesforceProvider(SalesforceProvider): package = "sfdo_template_helpers.oauth2.salesforce" - def get_auth_params(self, request, action): + def get_auth_params_from_request(self, request, action): ret = super().get_auth_params_from_request(request, action) # This will ensure that even if you're logged in to Salesforce, # you'll be prompted to choose an identity to auth as: diff --git a/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py b/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py index e8407ae..00aae2b 100644 --- a/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py @@ -17,7 +17,7 @@ def dummy_app(): @pytest.mark.django_db def test_get_auth_params(rf, dummy_app): request = rf.get("/") - result = SFDOSalesforceProvider(request, dummy_app).get_auth_params(request, None) + result = SFDOSalesforceProvider(request, dummy_app).get_auth_params_from_request(request, None) assert "prompt" in result and result["prompt"] == "login" From 0f1cbf1ab01062c9686e276461c8d6ecb8dc4410 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Mon, 4 Nov 2024 23:11:47 -0800 Subject: [PATCH 4/6] using get_auth_params --- sfdo_template_helpers/oauth2/salesforce/provider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfdo_template_helpers/oauth2/salesforce/provider.py b/sfdo_template_helpers/oauth2/salesforce/provider.py index d532168..9d50268 100644 --- a/sfdo_template_helpers/oauth2/salesforce/provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/provider.py @@ -4,8 +4,8 @@ class SFDOSalesforceProvider(SalesforceProvider): package = "sfdo_template_helpers.oauth2.salesforce" - def get_auth_params_from_request(self, request, action): - ret = super().get_auth_params_from_request(request, action) + def get_auth_params(self): + ret = super().get_auth_params() # This will ensure that even if you're logged in to Salesforce, # you'll be prompted to choose an identity to auth as: ret["prompt"] = "login" From 1ec1e1cb5f142696e7b17f3bccd27cce44266f51 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Mon, 4 Nov 2024 23:12:24 -0800 Subject: [PATCH 5/6] use get_auth_params --- sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py b/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py index 00aae2b..3a99d49 100644 --- a/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/tests/test_provider.py @@ -17,7 +17,7 @@ def dummy_app(): @pytest.mark.django_db def test_get_auth_params(rf, dummy_app): request = rf.get("/") - result = SFDOSalesforceProvider(request, dummy_app).get_auth_params_from_request(request, None) + result = SFDOSalesforceProvider(request, dummy_app).get_auth_params() assert "prompt" in result and result["prompt"] == "login" From 413a7a426cd88ecb7c2dc7ca090aa5a447b8dc63 Mon Sep 17 00:00:00 2001 From: Bharath Chadarajupalli Date: Mon, 4 Nov 2024 23:17:47 -0800 Subject: [PATCH 6/6] Update provider.py --- sfdo_template_helpers/oauth2/salesforce/provider.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sfdo_template_helpers/oauth2/salesforce/provider.py b/sfdo_template_helpers/oauth2/salesforce/provider.py index 9d50268..4582312 100644 --- a/sfdo_template_helpers/oauth2/salesforce/provider.py +++ b/sfdo_template_helpers/oauth2/salesforce/provider.py @@ -9,6 +9,7 @@ def get_auth_params(self): # This will ensure that even if you're logged in to Salesforce, # you'll be prompted to choose an identity to auth as: ret["prompt"] = "login" + ret["approval_prompt"] = "force" return ret def extract_uid(self, data):