-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth): Zope root logout Basic auth assumptions
See also [the PAS issue](zopefoundation/Products.PluggableAuthService#107 (comment)).
- Loading branch information
1 parent
a91a194
commit defb5df
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
A JWT token authentication plugin for PluggableAuthService. | ||
""" | ||
|
||
from App import Management | ||
from Products import PluggableAuthService # noqa, Ensure PAS patch in place | ||
|
||
|
||
_orig_manage_zmi_logout = Management.Navigation.manage_zmi_logout | ||
|
||
|
||
# BBB: Maybe remove depending on the outcome of the PAS issue: | ||
# https://github.com/zopefoundation/Products.PluggableAuthService/issues/107#issue-1090137890 | ||
def manage_zmi_logout(self, REQUEST, RESPONSE): | ||
""" | ||
Logout the current ZMI user without re-challenging for login credentials. | ||
""" | ||
_orig_manage_zmi_logout(self, REQUEST, RESPONSE) | ||
|
||
# Undo the HTTP `Authorization: Basic ...` assumptions | ||
RESPONSE.deleteHeader("WWW-Authenticate") | ||
RESPONSE.setStatus(200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:monkey="http://namespaces.plone.org/monkey" | ||
xmlns:zcml="http://namespaces.zope.org/zcml" | ||
i18n_domain="plone.volto" | ||
> | ||
|
||
<include package="collective.monkeypatcher" /> | ||
|
||
<monkey:patch | ||
original="manage_zmi_logout" | ||
replacement=".manage_zmi_logout" | ||
class="App.Management.Navigation" | ||
description="Patch ZMI logout to remove Basic auth assumptions" | ||
/> | ||
|
||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters