Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-16662200 - Fix auth params #52

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions sfdo_template_helpers/oauth2/salesforce/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class SFDOSalesforceProvider(SalesforceProvider):
package = "sfdo_template_helpers.oauth2.salesforce"

def get_auth_params(self, request, action):
ret = super().get_auth_params(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"
ret["approval_prompt"] = "force"
return ret

def extract_uid(self, data):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
assert "prompt" in result and result["prompt"] == "login"


Expand Down
Loading