PHP Classes

Misfit OAuth - Loop on permission page

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Misfit OAuth - Loop on permission page  >  (Un) Subscribe thread alerts  
Subject:Misfit OAuth - Loop on permission page
Summary:Misfit OAuth - Loop on permission page
Messages:6
Author:Boris MANCHETTE
Date:2015-03-10 22:15:11
 

  1. Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Boris MANCHETTE Boris MANCHETTE - 2015-03-10 22:15:11
Hello,

I try to use the PHP OAuth API class to interact with Misfit API.
I have configure the Misfit server like this in my JSON file:
"Misfit":
{
"oauth_version": "2.0",
"dialog_url": "https://api.misfitwearables.com/auth/dialog/authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}",
"access_token_url": "https://api.misfitwearables.com/auth/tokens/exchange",
"token_request_method": "POST"
}

When I try to interact with Misfit but calling a PHP page, I loop on Misfit permission page.

On the apache log file, I can find the following entries:
Tue Mar 10 23:06:01.579836 2015 - OAuth client: Redirecting to OAuth Dialog https://api.misfitwearables.com/auth/dialog/authorize?response_type=code&client_id=xxxxx&redirect_uri=xxxxx&scope=public%2Cbirthday%2Cemail
Tue Mar 10 23:06:01.579156 2015 - OAuth client: Checking the authentication state in URI /misfit_api/login_with_misfit.php?code=hD9RfnIZsFxRVcF6
Tue Mar 10 23:06:01.576001 2015 - OAuth client: A valid access token is not available
Tue Mar 10 23:06:01.563884 2015 - OAuth client: Checking if OAuth access token was already retrieved from https://api.misfitwearables.com/auth/tokens/exchange

Could you help me to resolve this behaviour?

Regards

  2. Re: Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-03-12 09:23:35 - In reply to message 1 from Boris MANCHETTE
It seems you are missing the state parameter.

Anyway, I just added support to Misfit in the current version.

  3. Re: Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Boris MANCHETTE Boris MANCHETTE - 2015-03-12 20:50:22 - In reply to message 2 from Manuel Lemos
Hello,

Thank you for your return and your work on Misfit integration.
With the oauth_configuration.json file delivered in last version, it's work fine.

Regards

  4. Re: Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Konstantin  Petrykin Konstantin Petrykin - 2015-03-17 09:40:41 - In reply to message 2 from Manuel Lemos
Hello! I have the same problem with facebook. There is something went wrong a few days ago, facebook worked fine earlier.

Apache error log:
OAuth client: Checking if OAuth access token was already retrieved from https://graph.facebook.com/oauth/access_token
OAuth client: A valid access token is not available
OAuth client: Checking the authentication state in URI /lib/php/oauth_api/login_with_facebook.php?
OAuth client: Redirecting to OAuth Dialog https://www.facebook.com/v2.2/dialog/oauth?scope=&response_type=token&client_id=527019294100321&redirect_uri=http%3A%2F%2Floyalpad.avtelcom.ru%2Flib%2Fphp%2Foauth_api%2Flogin_with_facebook.php&state=1426593116-82a433



  5. Re: Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-03-17 11:05:47 - In reply to message 4 from Konstantin Petrykin
Are you using the latest version of the class? It should say 1.133 at the top.

If so, are you sure your Web user has permissions to write sessions to the PHP session data directory?

  6. Re: Misfit OAuth - Loop on permission page   Reply   Report abuse  
Picture of Konstantin  Petrykin Konstantin Petrykin - 2015-03-18 06:18:16 - In reply to message 5 from Manuel Lemos
I have updated the class and everything works fine now... Thanks for help! =)