Expand my Community achievements bar.

SOLVED

using afcs.php to implement external authentication

Avatar

Level 2

We have been trying to follow the examples in the Cocomo Developers Guide and the sample application to start implementing an external authentication solution.  Neither our login application nor the sample provided in the SDK work for us.  Both fail when trying to log in with the same errors in the server log:

     PHP Fatal error:  Uncaught exception 'AFCSError' ...

We found an example for how to test the call from the command line of our server and were about to get a more complete dump of how this is failing. The response: <result code="unauthorized"> looks to us like the service is not allowing our adobe account to authenticate:

php afcs.php --debug --host=http://connectnow.acrobat.com OurAdobeAccount <OurUsername> <Ourpassword>

$Revision: #4 $ - $Date: 2009/09/28 $

http_get: http://connectnow.acrobat.com/OurAdobeAccount?mode=xml&accountonly=true&

<result code="unauthorized">

<baseURL href="https://na2.connectnow.acrobat.com:443/"/>

<authentication href="https://services.acrobat.com/account/wsapi/auth/v1"/>

</result>

http_post: https://services.acrobat.com/account/wsapi/auth/v1 <request><username> OurUsername </username><password> Ourpassword </password></request>

Array

(

    [Content-Type] => text/xml

)

Error: exception 'AFCSError' in /usr/local/apache2/htdocs/rg/afcs.php:575

Stack trace:

#0 /usr/local/apache2/htdocs/rg/afcs.php(64): AFCS->http_post(Object(SimpleXMLElement), '<request><usern...', Array)

#1 /usr/local/apache2/htdocs/rg/afcs.php(229): AFCSAuthenticator->login('OurUsername', 'Ourpassword', Array)

#2 /usr/local/apache2/htdocs/rg/afcs.php(636): AFCSAccount->login('OurUsername', 'Ourpassword')

#3 {main}>

We have searched through the forums and it does not look like other users are having the same difficulty.  We have tried two different Adobe accounts and both fail the same way.
Any help you can provide would be greatly appreciated

1 Accepted Solution

Avatar

Correct answer by
Employee

Line 575 in afcs.php is this:

573:      $fp = fopen($url, 'r', false, $context);

574:      if (! $fp)

575:        throw new AFCSError("connection-failed");

that means the POST to the authentication service didn't go through. I think you should be able to find more information about the real error in the PHP error log, but my guess is that you don't have the SSL module installed (this is a common error, since by default SSL is disabled). Right now I cannot find how to correctly configure PHP to be able to POST to https URL but if you still need it I can get that information tomorrow.

In the mean time, check your PHP error log and see if that's the real error.

View solution in original post

5 Replies

Avatar

Correct answer by
Employee

Line 575 in afcs.php is this:

573:      $fp = fopen($url, 'r', false, $context);

574:      if (! $fp)

575:        throw new AFCSError("connection-failed");

that means the POST to the authentication service didn't go through. I think you should be able to find more information about the real error in the PHP error log, but my guess is that you don't have the SSL module installed (this is a common error, since by default SSL is disabled). Right now I cannot find how to correctly configure PHP to be able to POST to https URL but if you still need it I can get that information tomorrow.

In the mean time, check your PHP error log and see if that's the real error.

Avatar

Level 2

Raff,

Thank you for your reply.  We checked with our server configuration and it does appear to have OpenSSL enabled.

extension=openssl.so

Apache VersionApache/2.2.11 (Unix) PHP/5.2.9 with Suhosin-Patch mod_ssl/2.2.11 OpenSSL/0.9.7m mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.7

Other than the original apache error log message, we are not  getting any error messages in the php error log to indicate a problem.  I am making the call from an https://URL  with a valid certificate.  I get the same error message as before. 

Avatar

Level 2

Raff.

Hold off on this.  I think we just found a configuration error in the PHP - even though the info I sent made it look like the configuration was correct.

Avatar

Level 2

Raff.

You were correct.  Even though it appeared that our php has been configured to use openssl, it was not finding the library file and was not using it.  Once we corrected that we were able to authenticate and proceed.

Thank you.