<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DUO Security 2fa (Two Factor) with Nextcloud 21 in APIs</title>
    <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/5132509#M790</link>
    <description>&lt;P&gt;Does not work anymore because of Duo Universal Prompt upgrades&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livteccloud_0-1718621384099.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/221014i0E35A54598D79C93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livteccloud_0-1718621384099.png" alt="livteccloud_0-1718621384099.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livteccloud_1-1718621394251.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/221015i23D8C7A45C3E1F76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livteccloud_1-1718621394251.png" alt="livteccloud_1-1718621394251.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyone has a solution for this? Plugin would need to be updated to be using Web SDK 4.&lt;/P&gt;&lt;P&gt;&lt;A href="https://duo.my.site.com/s/article/8753?language=en_US" target="_blank"&gt;Why do I see the error "Setup error. Your organization needs to upgrade this application to the Duo Universal Prompt" when logging into an application using the traditional Duo Prompt? (site.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Any other solution for using Nextcloud with 2FA via Duo?&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 10:51:00 GMT</pubDate>
    <dc:creator>livteccloud</dc:creator>
    <dc:date>2024-06-17T10:51:00Z</dc:date>
    <item>
      <title>DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876718#M65</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;H3&gt;
&lt;A name="i-use-centos-7-httpd-php-74-and-nexcloud-21-1" class="anchor" href="#i-use-centos-7-httpd-php-74-and-nexcloud-21-1"&gt;&lt;/A&gt;I use &lt;STRONG&gt;Centos 7&lt;/STRONG&gt;, &lt;STRONG&gt;HTTPD&lt;/STRONG&gt;, &lt;STRONG&gt;PHP 7.4&lt;/STRONG&gt; and &lt;STRONG&gt;Nexcloud 21&lt;/STRONG&gt;
&lt;/H3&gt;
&lt;P&gt;open and download from&lt;/P&gt;&lt;ASIDE class="onebox allowlistedgeneric" data-onebox-src="https://github.com/ChristophWurst/twofactor_duo"&gt;
  &lt;HEADER class="source"&gt;
      &lt;IMG src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="32" height="32" /&gt;

      &lt;A href="https://github.com/ChristophWurst/twofactor_duo" target="_blank" rel="noopener nofollow ugc"&gt;GitHub&lt;/A&gt;
  &lt;/HEADER&gt;

  &lt;ARTICLE class="onebox-body"&gt;
    &lt;DIV class="aspect-image" style="--aspect-ratio:690/345;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2X_e_e530ce6b619e1c811046dcc05db92056919acd0d.png" style="width: 690px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/190877i741B159296FE5087/image-size/large?v=v2&amp;amp;px=999" role="button" title="2X_e_e530ce6b619e1c811046dcc05db92056919acd0d.png" alt="2X_e_e530ce6b619e1c811046dcc05db92056919acd0d.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;

&lt;H3&gt;&lt;A href="https://github.com/ChristophWurst/twofactor_duo" target="_blank" rel="noopener nofollow ugc"&gt;ChristophWurst/twofactor_duo&lt;/A&gt;&lt;/H3&gt;

  &lt;P&gt;Experimental Duo two-factor auth provider for Nextcloud - ChristophWurst/twofactor_duo&lt;/P&gt;


  &lt;/ARTICLE&gt;

  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;

  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;
&lt;/ASIDE&gt;
&lt;P&gt;
then extract zip to your Nextcloud path at folder &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/apps/twofactor_duo&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open file &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/apps/twofactor_duo/appinfo/info.xml&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;just &lt;STRONG&gt;delete&lt;/STRONG&gt; this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;&amp;lt;dependencies&amp;gt;
	&amp;lt;php min-version="5.6" max-version="7.1" /&amp;gt;
	&amp;lt;nextcloud min-version="13" max-version="13" /&amp;gt;
&amp;lt;/dependencies&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and replace this &lt;CODE&gt;&amp;lt;category&amp;gt;auth&amp;lt;/category&amp;gt;&lt;/CODE&gt; to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;&amp;lt;category&amp;gt;integration&amp;lt;/category&amp;gt;
&amp;lt;category&amp;gt;security&amp;lt;/category&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;next, open &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/config/config.php&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;add this code before &lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;'twofactor_duo' =&amp;gt; [
  'IKEY' =&amp;gt; 'xxxx',
  'SKEY' =&amp;gt; 'xxxxx',
  'HOST' =&amp;gt; 'xxxxx',
  'AKEY' =&amp;gt; 'xxxx',
],
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;note: for &lt;STRONG&gt;AKEY&lt;/STRONG&gt; use &lt;STRONG&gt;IKEY&lt;/STRONG&gt; value&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open this files &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/lib/public/Authentication/TwoFactorAuth/IProvider.php&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;under “&lt;CODE&gt;interface IProvider&lt;/CODE&gt;” section find all of the public functions and remove the colon and type after the function name&lt;BR /&gt;
example: change “&lt;CODE&gt;public function getId(): string;&lt;/CODE&gt;” to “&lt;CODE&gt;public function getId();&lt;/CODE&gt;”.  This needs to be done for all six public functions.&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;search for “&lt;CODE&gt;public function getCSP&lt;/CODE&gt;”.  Comment out line and put in “&lt;CODE&gt;public function getCSP();&lt;/CODE&gt;”&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/lib/public/Authentication/TwoFactorAuth/IProvidesCustomCSP.php&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;search for “&lt;CODE&gt;public function getCSP&lt;/CODE&gt;”.  Comment out line and put in “&lt;CODE&gt;public function getCSP();&lt;/CODE&gt;”&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/core/Controller/TwoFactorChallengeController.php&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;search for “&lt;CODE&gt;return new StandaloneTemplateRe sponse&lt;/CODE&gt;” and comment out that line, and add this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;$response = new TemplateResponse($this-&amp;gt;appName, 'twofactorshowchallenge', $data, 'guest');
if ($provider instanceof IProvidesCustomCSP) {
  $response-&amp;gt;setContentSecurityPolicy($provider-&amp;gt;getCSP());
}
return $response;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;=====================================================================&lt;BR /&gt;
after this try to enable &lt;STRONG&gt;twofactor_duo&lt;/STRONG&gt; app, you can do it directly from your &lt;STRONG&gt;Nextcloud&lt;/STRONG&gt; Apps or use &lt;CODE&gt;occ&lt;/CODE&gt; from cli&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;cd /nextcloud/path/directory
sudo -u apache php occ app:enable twofactor_duo
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;=====================================================================&lt;BR /&gt;
use cli&lt;BR /&gt;
&lt;CODE&gt;sudo -u apache php occ integrity:check-core&lt;/CODE&gt;&lt;BR /&gt;
you will see &lt;STRONG&gt;INVALID_HASH&lt;/STRONG&gt; ( Failed integrity check, invalid hash)&lt;BR /&gt;
just see under detect file with have invalid hash, had &lt;STRONG&gt;expected&lt;/STRONG&gt; hash and &lt;STRONG&gt;current&lt;/STRONG&gt; hash&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;open &lt;EM&gt;&lt;STRONG&gt;[nextcloud_path]&lt;/STRONG&gt;/core/signature.json&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;find &lt;STRONG&gt;expected&lt;/STRONG&gt; hash  and then replace with &lt;STRONG&gt;current&lt;/STRONG&gt; hash, do it all&lt;/P&gt;
&lt;P&gt;=====================================================================&lt;BR /&gt;
now we must create &lt;EM&gt;signature&lt;/EM&gt; for &lt;STRONG&gt;twofactor_duo&lt;/STRONG&gt;&lt;BR /&gt;
first we must generate &lt;STRONG&gt;key&lt;/STRONG&gt; and then &lt;STRONG&gt;crt&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;sudo openssl genrsa -des3 -out /etc/ssl/twofactor.key 2048
sudo openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /etc/ssl/twofactor.key -out /etc/ssl/twofactor.crt
sudo -u apache php occ integrity:sign-app --path apps/twofactor_duo --privateKey /etc/ssl/twofactor.key --certificate /etc/ssl/twofactor.crt
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;=====================================================================&lt;BR /&gt;
try to &lt;STRONG&gt;logout&lt;/STRONG&gt; and &lt;STRONG&gt;login&lt;/STRONG&gt; again&lt;/P&gt;
&lt;H3&gt;
&lt;A name="good-luck-2" class="anchor" href="#good-luck-2"&gt;&lt;/A&gt;&lt;STRONG&gt;Good Luck&lt;/STRONG&gt;
&lt;/H3&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Jun 2021 08:01:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876718#M65</guid>
      <dc:creator>ardhie</dc:creator>
      <dc:date>2021-06-27T08:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876719#M66</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;&lt;A class="mention" href="https://community.duo.com/u/ardhie"&gt;@ardhie&lt;/A&gt; I’ve followed all of the steps above.&lt;BR /&gt;
After logging in, it brings me to a page located at &lt;A href="https://myserver/login/challenge/duo" rel="noopener nofollow ugc"&gt;https://myserver/login/challenge/duo&lt;/A&gt; showing the word Duo with no other text and no Duo push notification comes in unfortunately.&lt;BR /&gt;
This is on version 22.2&lt;BR /&gt;
Any advice?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Nov 2021 13:09:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876719#M66</guid>
      <dc:creator>MRobi</dc:creator>
      <dc:date>2021-11-04T13:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876720#M67</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Hello &lt;A class="mention" href="https://community.duo.com/u/mrobi"&gt;@MRobi&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have the same issue here.&lt;BR /&gt;
Did you find a solution?&lt;/P&gt;
&lt;P&gt;Thanks !&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 28 Nov 2021 15:30:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876720#M67</guid>
      <dc:creator>Benjamin_Hobbies</dc:creator>
      <dc:date>2021-11-28T15:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876721#M68</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;I just came back to this and actually got it working with a few changes.&lt;BR /&gt;
First and foremost for AKEY it should be 40 characters long, so copying IKEY doesn’t work. To generate the AKEY use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;dd if=/dev/random count=1 | sha256sum
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Copy the output into your config as AKEY&lt;/P&gt;
&lt;P&gt;All of the sudo -u apache commands should be changed to sudo -u www-data&lt;/P&gt;
&lt;P&gt;After those changes I had a few issues getting the app signed with the 3 commands in the final steps.&lt;BR /&gt;
What I did here is create the folders /etc/ssl from INSIDE the nextcloud install directory. So in my case they’re at /var/www/nextcloud/etc/ssl.&lt;/P&gt;
&lt;P&gt;So then I ran the command modified like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;sudo openssl genrsa -des3 -out /var/www/nextcloud/etc/ssl/twofactor.key 2048
sudo openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /var/www/nextcloud/etc/ssl/twofactor.key -out /etc/ssl/twofactor.crt
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now I ran into more issues trying to run the final command. First I was getting etc/ssl/twofactor.key does not exist. Permissions on the 2 generated files were 0600 and owner was root. So I changed the permissions to 0777 (likely not advised) and owner/group to www-data.&lt;/P&gt;
&lt;P&gt;Ran the final command and got Error: apps/twofactor_duo/appinfo is not writable.&lt;BR /&gt;
So I checked the permissions there, they were also 0600 and owner was root. So I did the same to the twofactor_duo directory and changed it to 0777 (also likely not advised) and owner/group to www-data.&lt;/P&gt;
&lt;P&gt;After changing the permissions there I ran this one last time from within the nextcloud directory&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;sudo -u apache php occ integrity:sign-app --path apps/twofactor_duo --privateKey etc/ssl/twofactor.key --certificate etc/ssl/twofactor.crt
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Successfully signed “apps/twofactor_duo”&lt;/P&gt;
&lt;P&gt;Signed out, signed back in, success!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Jan 2022 16:42:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876721#M68</guid>
      <dc:creator>MRobi</dc:creator>
      <dc:date>2022-01-23T16:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876722#M69</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;In case anyone is interested, there is this fork of the github repo in the original post: &lt;A href="https://github.com/srolfe/twofactor_duo" class="inline-onebox" rel="noopener nofollow ugc"&gt;GitHub - srolfe/twofactor_duo: Experimental Duo two-factor auth provider for Nextcloud&lt;/A&gt;&lt;BR /&gt;
I used this fork as is, without changing anything in nextcloud itself (beside the config part) and it works out of the box. I use nextcloud 23.0.3.&lt;/P&gt;
&lt;P&gt;In duo, I pressed protect an application and chose Web SDK type&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 07 May 2022 19:26:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/4876722#M69</guid>
      <dc:creator>shahar3000</dc:creator>
      <dc:date>2022-05-07T19:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: DUO Security 2fa (Two Factor) with Nextcloud 21</title>
      <link>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/5132509#M790</link>
      <description>&lt;P&gt;Does not work anymore because of Duo Universal Prompt upgrades&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livteccloud_0-1718621384099.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/221014i0E35A54598D79C93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livteccloud_0-1718621384099.png" alt="livteccloud_0-1718621384099.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livteccloud_1-1718621394251.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/221015i23D8C7A45C3E1F76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livteccloud_1-1718621394251.png" alt="livteccloud_1-1718621394251.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyone has a solution for this? Plugin would need to be updated to be using Web SDK 4.&lt;/P&gt;&lt;P&gt;&lt;A href="https://duo.my.site.com/s/article/8753?language=en_US" target="_blank"&gt;Why do I see the error "Setup error. Your organization needs to upgrade this application to the Duo Universal Prompt" when logging into an application using the traditional Duo Prompt? (site.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Any other solution for using Nextcloud with 2FA via Duo?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 10:51:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-security-2fa-two-factor-with-nextcloud-21/m-p/5132509#M790</guid>
      <dc:creator>livteccloud</dc:creator>
      <dc:date>2024-06-17T10:51:00Z</dc:date>
    </item>
  </channel>
</rss>

