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

Commit 28f8751

Browse files
committed
post_logout_redirect_uri not post_logout_redirect_uris
1 parent fac61ff commit 28f8751

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

example/flask_rp/conf.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@
162162
"redirect_uris": [
163163
"https://{domain}:{port}/authz_cb/local"
164164
],
165-
"post_logout_redirect_uris": [
166-
"https://{domain}:{port}/session_logout/local"
167-
],
165+
"post_logout_redirect_uri": "https://{domain}:{port}/session_logout/local",
168166
"frontchannel_logout_uri": "https://{domain}:{port}/fc_logout/local",
169167
"frontchannel_logout_session_required": true,
170168
"backchannel_logout_uri": "https://{domain}:{port}/bc_logout/local",
@@ -231,9 +229,7 @@
231229
"redirect_uris": [
232230
"https://{domain}:{port}/authz_cb/django"
233231
],
234-
"post_logout_redirect_uris": [
235-
"https://{domain}:{port}/session_logout/django"
236-
],
232+
"post_logout_redirect_uris": "https://{domain}:{port}/session_logout/django",
237233
"frontchannel_logout_uri": "https://{domain}:{port}/fc_logout/django",
238234
"frontchannel_logout_session_required": true,
239235
"backchannel_logout_uri": "https://{domain}:{port}/bc_logout/django",

src/oidcrp/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def extend(self, entity_conf, conf, base_path, file_attributes, domain, port):
100100

101101

102102
URIS = [
103-
"redirect_uris", 'post_logout_redirect_uris', 'frontchannel_logout_uri',
103+
"redirect_uris", 'post_logout_redirect_uri', 'frontchannel_logout_uri',
104104
'backchannel_logout_uri', 'issuer', 'base_url']
105105

106106

src/oidcrp/oidc/end_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def add_post_logout_redirect_uri(self, request_args=None, **kwargs):
5959
if _uri:
6060
request_args['post_logout_redirect_uri'] = _uri
6161
else:
62-
_uris = _context.callback.get("post_logout_redirect_uris", [])
62+
_uris = _context.callback.get("post_logout_redirect_uri", [])
6363
if _uris:
6464
request_args['post_logout_redirect_uri'] = _uris[0]
6565

src/oidcrp/oidc/registration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def create_callbacks(issuer: str,
8080
res["request_uris"] = f"{base_url}/req_uri/{_hex}"
8181

8282
if backchannel_logout_uri or frontchannel_logout_uri:
83-
res["post_logout_redirect_uris"] = [f"{base_url}/session_logout/{_hex}"]
83+
res["post_logout_redirect_uri"] = [f"{base_url}/session_logout/{_hex}"]
8484

8585
if backchannel_logout_uri:
8686
res["backchannel_logout_uri"] = f"{base_url}/bc_logout/{_hex}"
@@ -162,7 +162,7 @@ def add_callbacks(context, ignore: Optional[List[str]] = None):
162162
context.set('callback', callbacks)
163163

164164

165-
CALLBACK_URIS = ["post_logout_redirect_uris", "backchannel_logout_uri", "frontchannel_logout_uri",
165+
CALLBACK_URIS = ["post_logout_redirect_uri", "backchannel_logout_uri", "frontchannel_logout_uri",
166166
"request_uris", 'redirect_uris']
167167

168168

src/oidcrp/rp_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ def do_client_registration(self, client=None,
273273
self.hash2issuer[iss_id] = _iss
274274

275275
# This should only be interesting if the client supports Single Log Out
276-
# if _context.callback.get("post_logout_redirect_uris") is None:
277-
# _context.callback["post_logout_redirect_uris"] = [self.base_url]
276+
# if _context.callback.get("post_logout_redirect_uri") is None:
277+
# _context.callback["post_logout_redirect_uri"] = [self.base_url]
278278

279279
if not _context.client_id: # means I have to do dynamic client registration
280280
if request_args is None:

tests/test_13_oidc_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@ def test_construct(self):
608608

609609
def test_config_with_post_logout(self):
610610
self.service.client_get("service_context").register_args[
611-
'post_logout_redirect_uris'] = ['https://example.com/post_logout']
611+
'post_logout_redirect_uri'] = 'https://example.com/post_logout'
612612
_req = self.service.construct()
613613
assert isinstance(_req, RegistrationRequest)
614614
assert len(_req) == 5
615-
assert 'post_logout_redirect_uris' in _req
615+
assert 'post_logout_redirect_uri' in _req
616616

617617

618618
def test_config_with_required_request_uri():
@@ -666,7 +666,7 @@ def test_config_logout_uri():
666666
assert len(_req) == 7
667667
assert 'request_uris' in _req
668668
assert 'frontchannel_logout_uri' in _req
669-
assert 'post_logout_redirect_uris' in _req
669+
assert 'post_logout_redirect_uri' in _req
670670

671671

672672
class TestUserInfo(object):
@@ -874,7 +874,7 @@ def create_request(self):
874874
'redirect_uris': ['https://example.com/cli/authz_cb'],
875875
'issuer': self._iss, 'requests_dir': 'requests',
876876
'base_url': 'https://example.com/cli/',
877-
'post_logout_redirect_uris': ['https://example.com/post_logout']
877+
'post_logout_redirect_uri': 'https://example.com/post_logout'
878878
}
879879
services = {
880880
"checksession": {

tests/test_20_rp_handler_oidc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def test_do_client_registration(self):
312312
# only 2 things should have happened
313313

314314
assert self.rph.hash2issuer['github'] == issuer
315-
assert client.client_get("service_context").callback.get("post_logout_redirect_uris") is None
315+
assert client.client_get("service_context").callback.get("post_logout_redirect_uri") is None
316316

317317
def test_do_client_setup(self):
318318
client = self.rph.client_setup('github')

0 commit comments

Comments
 (0)