Skip to content

Commit

Permalink
Merge pull request #5 from OneIdentity/feature/add-askpass
Browse files Browse the repository at this point in the history
feature: add askpass config parameter
  • Loading branch information
krajorama authored Feb 3, 2021
2 parents 7670296 + e351120 commit 38199b6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SPS_AA_Skeleton
description: This is an example Python3 AA plugin
version: 1.0.0
version: 1.1.0
type: aa
api: 1.1
entry_point: main.py
Expand Down
3 changes: 3 additions & 0 deletions default.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[skeleton]

# To enable or disable asking for MFA password, configure 'ask_pass'.
; ask_pass=yes

#
# The follow comes from the Plugin SDK documentation on
# https://oneidentity.github.io/safeguard-sessions-plugin-sdk/
Expand Down
7 changes: 7 additions & 0 deletions plugin/plugin_bare.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@


class Plugin(AAPlugin):

def _extract_mfa_password(self):
if self.plugin_configuration.getboolean("skeleton", "ask_pass", default=True):
return super()._extract_mfa_password()
else:
return 'can pass'

def do_authenticate(self):
return AAResponse.accept('the reason to accept')

Expand Down
2 changes: 1 addition & 1 deletion plugin/tests/unit/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ...plugin_bare import Plugin

def test_authenticate_denies():
def test_authenticate_accepts():
config=''
parameters=dict(
cookie={},
Expand Down

0 comments on commit 38199b6

Please sign in to comment.