Skip to content

Commit

Permalink
Merge pull request keitaroinc#78 from GSA/logging-events
Browse files Browse the repository at this point in the history
Audit authentication events
  • Loading branch information
duskobogdanovski authored Jan 12, 2023
2 parents 43d6510 + 1203f68 commit 9943fb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.8', '3.9']
ckan-version: ["2.9", "2.10"]
Expand Down
5 changes: 5 additions & 0 deletions ckanext/saml2auth/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def logout(self):
# CKAN <= 2.9.x also sets auth_tkt cookie
response.set_cookie('auth_tkt', domain=domain, expires=0)

if g.userobj:
log.info(u'User {0}<{1}> logged out successfully'.format(g.userobj.name, g.userobj.email))
else:
log.info(u'No user was logged in!')

return response


Expand Down
2 changes: 2 additions & 0 deletions ckanext/saml2auth/views/saml2auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ def _log_user_into_ckan(resp):
user_id = g.userobj.name
set_repoze_user(user_id, resp)

log.info(u'User {0}<{1}> logged in successfully'.format(g.userobj.name, g.userobj.email))


def saml2login():
u'''Redirects the user to the
Expand Down

0 comments on commit 9943fb2

Please sign in to comment.