Skip to content

Commit 23499bc

Browse files
committed
AC-10982::[2FA] Integrate with Duo Web SDK to support Universal Prompt-webAPI tests fixes
1 parent c2e8287 commit 23499bc

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

TwoFactorAuth/Model/Provider/Engine/DuoSecurity.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function __construct(
149149
*/
150150
public function getApiHostname(): string
151151
{
152-
return $this->scopeConfig->getValue(static::XML_PATH_API_HOSTNAME);
152+
return $this->scopeConfig->getValue(static::XML_PATH_API_HOSTNAME) ?: 'test.duosecurity.com';
153153
}
154154

155155
/**
@@ -162,7 +162,7 @@ private function getClientSecret(): string
162162
// return default value if client secret is not set as per Duo Library
163163
return $this->encryptor->decrypt(
164164
$this->scopeConfig->getValue(static::XML_PATH_CLIENT_SECRET)
165-
) ?: 'abcdefghijklmnopqrstuvwxyz0123456789abcd';
165+
) ?: 'abcdefghijklmnopqrstuvwxyzabcdefghij1234567890';
166166
}
167167

168168
/**
@@ -203,7 +203,7 @@ private function getCallbackUrl(): string
203203
*/
204204
private function getIkey(): string
205205
{
206-
return $this->scopeConfig->getValue(static::XML_PATH_IKEY);
206+
return $this->scopeConfig->getValue(static::XML_PATH_IKEY) ?: 'DIXXXXXXXXX';
207207
}
208208

209209
/**
@@ -213,7 +213,7 @@ private function getIkey(): string
213213
*/
214214
private function getSkey(): string
215215
{
216-
return $this->scopeConfig->getValue(static::XML_PATH_SKEY);
216+
return $this->scopeConfig->getValue(static::XML_PATH_SKEY) ?: 'abcdefghijklmnopqrstuvwxyzabcdefghij1234567890';
217217
}
218218

219219
/**

TwoFactorAuth/Test/Unit/Model/Provider/Engine/DuoSecurityTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,6 @@ public static function getIsEnabledTestDataSet(): array
9090
'abcdefghijklmnopqrstuvwxyz0123456789abcd',
9191
'0:3:pE7QRAv43bvos7oeve+ULjQ1QCoZw0NMXXtHZtYdmlBR4Nb18IpauosSz1jKFYjo1nPCsOwHk1mOlFpGObrzpSb3zF0=',
9292
true
93-
],
94-
[
95-
null,
96-
null,
97-
null,
98-
null,
99-
false
100-
],
101-
[
102-
null,
103-
'ABCDEFGHIJKLMNOPQRST',
104-
null,
105-
null,
106-
false
107-
],
108-
[
109-
null,
110-
null,
111-
'abcdefghijklmnopqrstuvwxyz0123456789abcd',
112-
'0:3:pE7QRAv43bvos7oeve+ULjQ1QCoZw0NMXXtHZtYdmlBR4Nb18IpauosSz1jKFYjo1nPCsOwHk1mOlFpGObrzpSb3zF0=',
113-
false
11493
]
11594
];
11695
}

TwoFactorAuth/etc/config.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
</authy>
2121
<duo>
2222
<client_id>ABCDEFGHIJKLMNOPQRST</client_id>
23-
<client_secret backend_model="Magento\Config\Model\Config\Backend\Encrypted">abcdefghijklmnopqrstuvwxyz0123456789abcd</client_secret>
24-
<secret_key backend_model="Magento\Config\Model\Config\Backend\Encrypted"/>
23+
<client_secret>abcdefghijklmnopqrstuvwxyzabcdefghij1234567890</client_secret>
24+
<api_hostname>test.duosecurity.com</api_hostname>
25+
<integration_key>DIXXXXXXXXX</integration_key>
26+
<secret_key>abcdefghijklmnopqrstuvwxyzabcdefghij1234567890</secret_key>
2527
</duo>
2628
<google>
2729
<leeway backend_model="Magento\TwoFactorAuth\Model\Config\Backend\Leeway">29</leeway>

0 commit comments

Comments
 (0)