Skip to content

Commit 416d501

Browse files
committed
openid_connect_frontend.yaml.example: leverage <base_url> template
Setting an alternative issuer should not be an encouraged setup, although provider discovery should work either way. The recommended setting is to use the BASE as the issuer, and we can leverage the agressive configuration value replacement logic, which rewrites all occurences of <base_url> to the value of BASE. The unit test was modified to guarantee this behaviour, though.
1 parent 0c8ab4f commit 416d501

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

example/plugins/frontends/openid_connect_frontend.yaml.example

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ config:
3333
sub_hash_salt: randomSALTvalue
3434

3535
provider:
36-
# If you do not specify the issuer here, then BASE will be used as Issuer.
37-
# Note that even though this setting must be specified as a full URL,
38-
# provider discovery will only work, if the request can be routed back to
39-
# SATOSA.
40-
issuer: https://op.example.com/satosa/OIDC
36+
issuer: <base_url>
4137
client_registration_supported: Yes
4238
response_types_supported: ["code", "id_token token"]
4339
subject_types_supported: ["pairwise"]

tests/flows/test_oidc-saml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
CLIENT_REDIRECT_URI = "https://client.example.com/cb"
2929
REDIRECT_URI = "https://client.example.com/cb"
3030
DB_URI = "mongodb://localhost/satosa"
31-
EXTRA_ISSUER = "https://other-op.example.com/satosa/other/op"
31+
EXTRA_ISSUER = "<base_url>/other/op"
3232

3333
@pytest.fixture(scope="session")
3434
def client_db_path(tmpdir_factory):
@@ -117,7 +117,7 @@ def test_full_flow(self, satosa_config_dict, oidc_frontend_config, saml_backend_
117117
test_client = Client(make_app(SATOSAConfig(satosa_config_dict)), Response)
118118

119119
# get frontend OP config info
120-
issuer = EXTRA_ISSUER
120+
issuer = EXTRA_ISSUER.replace("<base_url>", satosa_config_dict["BASE"])
121121
provider_config = self._discover_provider(test_client, issuer)
122122

123123
# create auth req

0 commit comments

Comments
 (0)