<?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 Duo PHP example returns length error for secret key in APIs</title>
    <link>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882257#M429</link>
    <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I’m trying to get a test application working with Duo in PHP.  I’m following all of the instructions on GitHub, found here:&lt;/P&gt;
&lt;ASIDE class="onebox allowlistedgeneric" data-onebox-src="https://github.com/duosecurity/duo_php"&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/duosecurity/duo_php" 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_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" style="width: 690px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/191024i02C8E32CA7CA3429/image-size/large?v=v2&amp;amp;px=999" role="button" title="2X_e_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" alt="2X_e_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;

&lt;H3&gt;&lt;A href="https://github.com/duosecurity/duo_php" target="_blank" rel="noopener nofollow ugc"&gt;GitHub - duosecurity/duo_php: Duo two-factor authentication for PHP web...&lt;/A&gt;&lt;/H3&gt;

  &lt;P&gt;Duo two-factor authentication for PHP web applications - GitHub - duosecurity/duo_php: Duo two-factor authentication for PHP web applications&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;However, when I run the interactive mode example under the &lt;STRONG&gt;Using&lt;/STRONG&gt; section, I get an error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;$ php -a -d auto_prepend_file=vendor/autoload.php
Interactive mode enabled

&amp;lt;?php
var_dump(Duo\Web::signRequest("my-IKEY-goes-here", "my-SKEY-goes-here", "my-API-host-here", "myuser"));
?&amp;gt;
string(72) "ERR|The application secret key specified must be at least 40 characters."
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But the secret key value is exactly 40 characters, so I don’t know why this is happening.  Any help is greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;
Dave&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 23 Jun 2022 14:42:24 GMT</pubDate>
    <dc:creator>d_a_parker</dc:creator>
    <dc:date>2022-06-23T14:42:24Z</dc:date>
    <item>
      <title>Duo PHP example returns length error for secret key</title>
      <link>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882257#M429</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I’m trying to get a test application working with Duo in PHP.  I’m following all of the instructions on GitHub, found here:&lt;/P&gt;
&lt;ASIDE class="onebox allowlistedgeneric" data-onebox-src="https://github.com/duosecurity/duo_php"&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/duosecurity/duo_php" 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_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" style="width: 690px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/191024i02C8E32CA7CA3429/image-size/large?v=v2&amp;amp;px=999" role="button" title="2X_e_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" alt="2X_e_e5922c8c6f2373a862f5aee6d58a84dd063935d7.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;

&lt;H3&gt;&lt;A href="https://github.com/duosecurity/duo_php" target="_blank" rel="noopener nofollow ugc"&gt;GitHub - duosecurity/duo_php: Duo two-factor authentication for PHP web...&lt;/A&gt;&lt;/H3&gt;

  &lt;P&gt;Duo two-factor authentication for PHP web applications - GitHub - duosecurity/duo_php: Duo two-factor authentication for PHP web applications&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;However, when I run the interactive mode example under the &lt;STRONG&gt;Using&lt;/STRONG&gt; section, I get an error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;$ php -a -d auto_prepend_file=vendor/autoload.php
Interactive mode enabled

&amp;lt;?php
var_dump(Duo\Web::signRequest("my-IKEY-goes-here", "my-SKEY-goes-here", "my-API-host-here", "myuser"));
?&amp;gt;
string(72) "ERR|The application secret key specified must be at least 40 characters."
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But the secret key value is exactly 40 characters, so I don’t know why this is happening.  Any help is greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;
Dave&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jun 2022 14:42:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882257#M429</guid>
      <dc:creator>d_a_parker</dc:creator>
      <dc:date>2022-06-23T14:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Duo PHP example returns length error for secret key</title>
      <link>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882258#M430</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Looking at the &lt;CODE&gt;Web.php&lt;/CODE&gt; source code, I found where the error originates from.  It looks like the &lt;CODE&gt;signRequest()&lt;/CODE&gt; function expects an integration key (&lt;CODE&gt;$ikey&lt;/CODE&gt;), secret key (&lt;CODE&gt;$skey&lt;/CODE&gt;), application secret key (&lt;CODE&gt;$akey&lt;/CODE&gt;), and username.  The problem is that I am providing an API hostname for &lt;CODE&gt;$akey&lt;/CODE&gt; because that’s what I have.&lt;/P&gt;
&lt;P&gt;When I look at the details for this Application in the Duo admin portal, it shows me an integration key, secret key, and API hostname.  There is no 40-character “application key” that I can find anywhere.&lt;/P&gt;
&lt;P&gt;Is there something I’m missing here?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;
Dave&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jun 2022 15:02:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882258#M430</guid>
      <dc:creator>d_a_parker</dc:creator>
      <dc:date>2022-06-23T15:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Duo PHP example returns length error for secret key</title>
      <link>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882259#M431</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Never mind!  I found it in the Web v2 SDK documentation.  Generated an akey of my own and now it all works.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jun 2022 15:11:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/duo-php-example-returns-length-error-for-secret-key/m-p/4882259#M431</guid>
      <dc:creator>d_a_parker</dc:creator>
      <dc:date>2022-06-23T15:11:18Z</dc:date>
    </item>
  </channel>
</rss>

