Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit f62064f

Browse files
committed
creating iframe with frontchannel_logout_uri that contains a query part was not done correctly.
1 parent 022ebc4 commit f62064f

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/oidcendpoint/oidc/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def do_front_channel_logout_iframe(cinfo, iss, sid):
5151
_args = parse_qs(p.query)
5252
_args.update(_query)
5353
_query = _args
54+
_np = p._replace(query='')
55+
frontchannel_logout_uri = _np.geturl()
5456

5557
_iframe = '<iframe src="{}?{}">'.format(frontchannel_logout_uri,
5658
urlencode(_query, doseq=True))

tests/test_30_end_session.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,16 @@ def test_front_channel_logout_session_required(self):
398398
res = do_front_channel_logout_iframe(_cdb, ISS,'_sid_')
399399
assert res == '<iframe src="https://example.com/fc_logout?iss=https%3A%2F%2Fexample.com%2F&sid=_sid_">'
400400

401+
def test_front_channel_logout_with_query(self):
402+
self._code_auth('1234567')
403+
404+
_cdb = copy.copy(self.session_endpoint.endpoint_context.cdb['client_1'])
405+
_cdb['frontchannel_logout_uri'] = 'https://example.com/fc_logout?entity_id=foo'
406+
_cdb['frontchannel_logout_session_required'] = True
407+
_cdb['client_id'] = 'client_1'
408+
res = do_front_channel_logout_iframe(_cdb, ISS, '_sid_')
409+
assert res == '<iframe src="https://example.com/fc_logout?entity_id=foo&iss=https%3A%2F%2Fexample.com%2F&sid=_sid_">'
410+
401411
def test_logout_from_client_bc(self):
402412
self._code_auth('1234567')
403413
self.session_endpoint.endpoint_context.cdb['client_1']['backchannel_logout_uri'] = 'https://example.com/bc_logout'

0 commit comments

Comments
 (0)