Skip to content

Commit 006ef91

Browse files
committed
AC-10982::[2FA] Integrate with Duo Web SDK to support Universal Prompt-fixes for copyright year and text
1 parent 12ad392 commit 006ef91

File tree

27 files changed

+44
-39
lines changed

27 files changed

+44
-39
lines changed

TwoFactorAuth/Api/DuoAuthenticateInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Api/DuoConfigureInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Block/Adminhtml/System/Config/Providers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Block/Provider/Duo/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Controller/Adminhtml/Duo/Authpost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66
declare(strict_types=1);

TwoFactorAuth/Model/Provider/Engine/DuoSecurity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Model/Provider/Engine/DuoSecurity/Authenticate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Model/Provider/Engine/DuoSecurity/Configure.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

@@ -67,15 +67,20 @@ public function getConfigurationData(string $tfaToken)
6767

6868
/**
6969
* @inheritDoc
70+
* @throws \LocalizedException
7071
*/
7172
public function activate(string $tfaToken): void
7273
{
73-
$user = $this->userAuthenticator->authenticateWithTokenAndProvider($tfaToken, DuoSecurity::CODE);
74-
$userId = (int)$user->getId();
74+
try {
75+
$user = $this->userAuthenticator->authenticateWithTokenAndProvider($tfaToken, DuoSecurity::CODE);
76+
$userId = (int)$user->getId();
7577

76-
if ($this->duo->assertUserIsValid($user->getUserName()) == "auth") {
77-
$this->tfa->getProviderByCode(DuoSecurity::CODE)
78-
->activate($userId);
78+
if ($this->duo->assertUserIsValid($user->getUserName()) == "auth") {
79+
$this->tfa->getProviderByCode(DuoSecurity::CODE)
80+
->activate($userId);
81+
}
82+
} catch (\Exception $e) {
83+
throw new \LocalizedException(__('Could not activate Duo Security provider.'));
7984
}
8085
}
8186
}

TwoFactorAuth/Setup/Patch/Data/EncryptSecrets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
3+
* Copyright 2020 Adobe
44
* All Rights Reserved.
55
*/
66

TwoFactorAuth/Test/Integration/Block/ChangeProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2020 Adobe
4+
* All Rights Reserved.
55
*/
66

77
declare(strict_types=1);

0 commit comments

Comments
 (0)