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