Marcus Link - 2013-02-27 21:04:34 - In reply to message 3 from Manuel Lemos
It's a partner API utilizing OAuth, Restful endpoints, and JSON.
This redirect issue arises when using your test_oauth_client.php: it forwards us to server and returns the correct response on screen. That's it.
This much I can pass on:
... OAuth process which follows the OAuth 2.0 specifications and presents all its processes in a restful state.
Our current OAuth implementation adheres to the following specifications:
 The OAuth 2.0 Authorization Protocol (rev 16)
 The OAuth 2.0 Authorization Protocol: Bearer Tokens (rev 16)
[The API] is completely restful. All endpoints are designed to respond in a restful manor and all status codes returned represent the correct HTTP 1.1 expectations. You can find all information on these at http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
RESPONSE DATA FORMAT
[The API] returns data in one of two standardly accepted formats JSON and XML. By default we return JSON, if a request presents the HTTP Header “Accept: application/xml” or “Accept: text/xml” we will send XML instead. We strongly suggest using the default JSON response content type as it is a commonly accepted standard of mobile development. Endpoints take JSON objects under the PUT, DELETE and POST verbs. (see the Endpoints section for more details)
Manuel Lemos - 2013-02-28 00:14:31 - In reply to message 4 from Marcus Link
I see but this does not help clarifying the problem.
OAuth is a protocol standard but each server implements it in different ways that make it work differently.
The class provides means to adjust certain details of the way each API work but I have way of knowing what details to adjust without seeing in practice what comes from the server. From what you tell me, I can only guess.
It seems that the server redirects back to your script but if the class does not proceed with the protocol, maybe something is missing.
I suspect it can be the state parameter that the class uses to avoid security attacks.
You may want to enable debugging information setting the debug variable and see what appears in the PHP error log.
Marcus Link - 2013-02-28 00:32:04 - In reply to message 5 from Manuel Lemos
I understand. And, yes, indeed I am logging. Here's an example:
[27-Feb-2013 17:56:44] OAuth client: Checking if OAuth access token was already retrieved from https://secure.example.com/OAuth/access_token
[27-Feb-2013 17:56:44] OAuth client: Checking the authentication state in URI /api_demos/test_oauth_client.php
[27-Feb-2013 17:56:44] OAuth client: Redirecting to OAuth Dialog https://secure.example.com/OAuth/access_token?client_id=clientid.subdomain.example.com&client_secret=6CD3B809-BEC3-4684-BFC0-26D68A816878&grant_type=client_credentials&scope=RegisterUser&redirect_uri=http%3A%2F%2Fsubdomain.example.com%2Fapi_demos%2Ftest_oauth_client.php
[28-Feb-2013 10:21:01] OAuth client: Checking if OAuth access token was already retrieved from https://secure.serverdomain.com/OAuth/access_token
[28-Feb-2013 10:21:01] OAuth client: Checking the authentication state in URI /api_demos/test_oauth_client.php
[28-Feb-2013 10:21:01] OAuth client: Redirecting to OAuth Dialog https://secure.serverdomain.com/OAuth/access_token?client_id=clientid.subdomain.serverdomain.com&client_secret=6CD3B809-BEC3-4684-BFC0-26D68A816878&grant_type=client_credentials&scope=RegisterUser&redirect_uri=http%3A%2F%2Fsubdomain.clientdomain.com%2Fapi_demos%2Ftest_oauth_client.php