PHP Classes

Polar oAuth Error 400

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Polar oAuth Error 400  >  (Un) Subscribe thread alerts  
Subject:Polar oAuth Error 400
Summary:Unable to retrieve access token after successful authentication
Messages:3
Author:primeapple
Date:2022-08-09 18:21:33
 

  1. Polar oAuth Error 400   Reply   Report abuse  
Picture of primeapple primeapple - 2022-08-09 18:21:33
Hi,

I'm using the Polar oAuth and I've managed to get the dialog_url working (however Polar Flow only works if the redirect_uri is not URLEncoded - I hard coded the URI in the oauth_configuration.json to resovle this issue).

Now when the library is attempting to get the OAuth access token at https://polarremote.com/v2/oauth2/token it returns HTTP/1.1 400 Bad Request

I've tried your login_with_polar.php example and it has the same issue.

Any help is much appreciated and debug log below!

+++++++++++++++++++++++++++

OAuth client: Checking if OAuth access token was already retrieved from https://polarremote.com/v2/oauth2/token
OAuth client: A valid access token is not available
OAuth client: Getting the authentication state from URI /webhooks.php?action=polar&state=1660066593-98af6f&code=2962c7e3c7a6f4d5389f227139534b94
OAuth client: Checking the authentication state
OAuth client: Checking the authentication code
OAuth client: Accessing the OAuth access token at https://polarremote.com/v2/oauth2/token
Connecting to polarremote.com
Resolving HTTP server domain "polarremote.com"...
Connecting to HTTP server IP 52.49.243.115 port 443...
Connected to polarremote.com
C POST /v2/oauth2/token HTTP/1.1
C Host: polarremote.com
C User-Agent: PHP-OAuth-API (http://www.phpclasses.org/oauth-api $Revision: 1.173 $)
C Accept: */*
C Authorization: Basic [REMOVED]
C Connection: Keep-Alive
C Content-Type: application/x-www-form-urlencoded
C Content-Length: 147
C
C code=2962c7e3c7a6f4d5389f227139534b94&redirect_uri=[REMOVED]&grant_type=authorization_code
S HTTP/1.1 400 Bad Request

  2. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-08-10 04:35:12 - In reply to message 1 from primeapple
Hello,

Give me some time to try the login_with_polar.php script again.

  3. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of primeapple primeapple - 2022-08-10 09:25:21 - In reply to message 2 from Manuel Lemos
Thanks Manuel, appreciate you taking the time to take a look.

 
For more information send a message to info at phpclasses dot org.