Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/DIRAC/Resources/IdProvider/IdProviderFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ def getIdProvider(self, name, client_name_prefix="", **kwargs):

if client_name_prefix:
client_name_prefix = client_name_prefix + "_"
pDict["client_id"] = pDict[f"{client_name_prefix}client_id"]
pDict["client_secret"] = pDict[f"{client_name_prefix}client_secret"]
if f"{client_name_prefix}client_id" in pDict:
pDict["client_id"] = pDict[f"{client_name_prefix}client_id"]
if f"{client_name_prefix}client_secret" in pDict:
pDict["client_secret"] = pDict[f"{client_name_prefix}client_secret"]

pDict.update(kwargs)
pDict["ProviderName"] = name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
client_secret = IdP_client_secret
scope = openid+profile+offline_access+eduperson_entitlement
}
SomeIdP3.partial
{
ProviderType = OAuth2
issuer = https://and-another-idp.url/
scope = openid+profile+offline_access+eduperson_entitlement
}
}
}
"""
Expand All @@ -77,6 +83,7 @@
("SomeIdP1.2", {"OK": True}, "https://idp.url/", "IdP_client_id2", "IdP_client_secret"),
("SomeIdP2", {"OK": True}, "https://another-idp.url/", "IdP_client_id1", "IdP_client_secret"),
("SomeIdP3", {"OK": True}, "https://and-another-idp.url/", "IdP_client_id3", "IdP_client_secret"),
("SomeIdP3.partial", {"OK": True}, "https://and-another-idp.url/", None, None),
# Try to get an unknown DIRAC client
("DIRACUnknown", {"OK": False, "Message": "DIRACUnknown does not exist"}, None, None, None),
],
Expand Down
Loading