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:7
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.

  4. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of primeapple primeapple - 2022-10-12 09:22:01 - In reply to message 2 from Manuel Lemos
Hi Manuel,

Apologies for chasing, are you able to look into this for me as I've still not been able to find a resolution?

Thanks.

  5. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-12 09:52:12 - In reply to message 4 from primeapple
Hello,

Sorry I still have this on my to do list. Can you wait until the weekend so I can have more time to evaluate the problem?

  6. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of primeapple primeapple - 2022-10-12 10:56:31 - In reply to message 5 from Manuel Lemos
Thanks for your reply and of course, any help you can offer is greatly appreciated!

  7. Re: Polar oAuth Error 400   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2022-10-17 06:54:49 - In reply to message 1 from primeapple
Hello,

I tried it and I was able to get the access token but I had to go to Polar Access Link administration panel and ask to get new client credentials.

admin.polaraccesslink.com/#/clients

Can you try to get new credentials and let me know if it works for you?