PHP Classes

Polar OAuth client error

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Polar OAuth client error  >  (Un) Subscribe thread alerts  
Subject:Polar OAuth client error
Summary:login_with_polar.php, error 403
Messages:11
Author:Francesco
Date:2023-06-07 11:23:13
 
  1 - 10   11 - 11  

  1. Polar OAuth client error   Reply   Report abuse  
Picture of Francesco Francesco - 2023-06-07 11:23:13
Hi,
using login_with_polar.php I get this error when I call https://www.polaraccesslink.com/v3/users/{$user_id}

"Error: it was not possible to access the API call: it was returned an unexpected response status 403 Response:"

Here's the error log:

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 /polar/oauth/login_with_polar.php?state=1686136518-e33fa5&code=3109f4e1906eb08c736c63e0774a1826
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
OAuth client: Access token: 341c950130b231c0806df6d05a764a79
OAuth client: Access token expiry: 2033-06-04 11:15:18 UTC
OAuth client: Access token type: bearer
OAuth client: Accessing the API call at https://www.polaraccesslink.com/v3/users/60127039
OAuth client: Could not retrieve the OAuth access token. Error: it was not possible to access the API call: it was returned an unexpected response status 403 Response:
OAuth client: Resetting the access token status for OAuth server located at https://polarremote.com/v2/oauth2/token

Can you please help me? Thank you

  2. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-06-08 06:45:48 - In reply to message 1 from Francesco
Hello Francesco,

Can you set the debug and debug_http variables to true and reply here with the new log messages that appear?

  3. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Francesco Francesco - 2023-06-09 10:27:40 - In reply to message 2 from Manuel Lemos
Hi Manuel,
thank you for your reply.
Here's the log:

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 /polar/oauth/login_with_polar.php?state=1686306370-c42a7e&code=b8301d830520246cf3f37e80678f9354
OAuth client: Checking the authentication state
OAuth client: The authentication state is not valid.
OAuth client: Redirecting to OAuth Dialog https://flow.polar.com/oauth2/authorization?response_type=code&scope=accesslink.read_all&client_id=1aeb1a53-3513-47f2-b37f-6a043874ccb6&redirect_uri=https%3A%2F%2Fwww.magneticdays.com%2Fpolar%2Foauth%2Flogin_with_polar.php&state=1686306399-05eca0
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 /polar/oauth/login_with_polar.php?state=1686306399-05eca0&code=6b97bdca39662aae80f867665ead8c8d
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 34.240.175.202 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.187 $)
C Accept: */*
C Authorization: Basic MWFlYjFhNTMtMzUxMy00N2YyLWIzN2YtNmEwNDM4NzRjY2I2OmRjOGYyNWE5LTNhZjktNGIwMC05ODY5LWFiMTRhYTdhODdjZQ==
C Connection: Keep-Alive
C Content-Type: application/x-www-form-urlencoded
C Content-Length: 154
C
C code=6b97bdca39662aae80f867665ead8c8d&redirect_uri=https%3A%2F%2Fwww.magneticdays.com%2Fpolar%2Foauth%2Flogin_with_polar.php&grant_type=authorization_code
S HTTP/1.1 200 OK
S Date: Fri, 09 Jun 2023 10:26:40 GMT
S Content-Type: application/json;charset=utf-8
S Transfer-Encoding: chunked
S Connection: keep-alive
S Set-Cookie: AWSALB=EwE0JpgpC8bej/oNIaAYiB481VEde3eudU1noQDJnIJHlHX6GxdSQzCJJeY9O4gcpqjKOJGaSMtUVgJ0DcfG8bHPrO3B8E5OXULRkdOhakpuNw1+TvHHAgd6SMWn; Expires=Fri, 16 Jun 2023 10:26:40 GMT; Path=/
S Set-Cookie: AWSALBCORS=EwE0JpgpC8bej/oNIaAYiB481VEde3eudU1noQDJnIJHlHX6GxdSQzCJJeY9O4gcpqjKOJGaSMtUVgJ0DcfG8bHPrO3B8E5OXULRkdOhakpuNw1+TvHHAgd6SMWn; Expires=Fri, 16 Jun 2023 10:26:40 GMT; Path=/; SameSite=None; Secure
S Polar-Correlation-Id: e051b5c1-2c61-41fe-b808-784871f37c9d
S Access-Control-Allow-Origin: *
S Access-Control-Allow-Credentials: true
S Access-Control-Expose-Headers: Content-Length, Polar-Required-Account-Verifications
S Cache-Control: no-cache, no-store, must-revalidate
S Pragma: no-cache
S Expires: Thu, 01 Jan 1970 00:00:00 GMT
S
S 75
S {"access_token":"957c9c8e36a54d8681d1f41e7fdbd697","token_type":"bearer","expires_in":315359999,"x_user_id":60127039}
S 0
S
Keeping the connection alive to polarremote.com
OAuth client: Access token: 957c9c8e36a54d8681d1f41e7fdbd697
OAuth client: Access token expiry: 2033-06-06 10:26:39 UTC
OAuth client: Access token type: bearer
OAuth client: Accessing the API call at https://www.polaraccesslink.com/v3/users/60127039
Connecting to www.polaraccesslink.com
Resolving HTTP server domain "www.polaraccesslink.com"...
Connecting to HTTP server IP 63.32.174.245 port 443...
Connected to www.polaraccesslink.com
C GET /v3/users/60127039 HTTP/1.1
C Host: www.polaraccesslink.com
C User-Agent: PHP-OAuth-API (http://www.phpclasses.org/oauth-api $Revision: 1.187 $)
C Accept: application/json
C Authorization: Bearer 957c9c8e36a54d8681d1f41e7fdbd697
C Connection: Keep-Alive
C
S HTTP/1.1 403
S Date: Fri, 09 Jun 2023 10:26:40 GMT
S Content-Length: 0
S Connection: keep-alive
S Set-Cookie: AWSALB=VcMsx2MVsEQ1qWT2pys6QlV0/x6c5SDL5s6tPP7BwoCTBk5tzefNi+/1S4ILZrvSi8r78ATbEZvJnDv5IChWxpz9qhtrkoBg+0QlkNpWTPH8auanhoqIfGo4aeIz; Expires=Fri, 16 Jun 2023 10:26:40 GMT; Path=/
S Set-Cookie: AWSALBCORS=VcMsx2MVsEQ1qWT2pys6QlV0/x6c5SDL5s6tPP7BwoCTBk5tzefNi+/1S4ILZrvSi8r78ATbEZvJnDv5IChWxpz9qhtrkoBg+0QlkNpWTPH8auanhoqIfGo4aeIz; Expires=Fri, 16 Jun 2023 10:26:40 GMT; Path=/; SameSite=None; Secure
S Polar-Correlation-Id: 4b483c67-37ac-48ae-b813-d784392b194c
S RateLimit-Usage: 3, 3
S RateLimit-Limit: 500, 5000
S RateLimit-Reset: 728, 86228
S
Disconnected from www.polaraccesslink.com
OAuth client: Could not retrieve the OAuth access token. Error: it was not possible to access the API call: it was returned an unexpected response status 403 Response:
OAuth client: Resetting the access token status for OAuth server located at https://polarremote.com/v2/oauth2/token

  4. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-06-10 05:29:01 - In reply to message 3 from Francesco
Hello Francesco,

I tried it here, and I also got the same error.

I accessed the documentation to confirm the script is doing what is documented:

polar.com/accesslink-api/?http#regi ...

Maybe it is a temporary issue related to something that changed this year.

Can you contact the support of Polar and ask what can the issue is to make this script return HTTP 403 and then return here when you get a response from them?

The support email address is here:

polar.com/accesslink-api/?http#pola ...

  5. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Oliver Metzlaff Oliver Metzlaff - 2023-07-14 19:50:02 - In reply to message 4 from Manuel Lemos
Hello, is there already a solution? I just implemented Polar API and I have the same problem :(

  6. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-07-17 03:47:13 - In reply to message 5 from Oliver Metzlaff
Hello Oliver,

Unfortunately, I was not able to work on this project lately due to projects for customers that have been increasing.

If you have an urgency, would you like to contact me privately by sending a message to me by going here?

phpclasses.org/professionals/contac ...

  7. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Keith Fong Keith Fong - 2023-09-12 05:37:58 - In reply to message 6 from Manuel Lemos
hi, does it got solution?

  8. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-09-12 07:53:22 - In reply to message 7 from Keith Fong
Hello Keith,

Sorry, I am struggling with time to look into this.

I just bumped this issue to look into it next weekend.

Can you please wait until then?

  9. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Keith Fong Keith Fong - 2023-09-12 09:32:23 - In reply to message 8 from Manuel Lemos
ok, thanks.

  10. Re: Polar OAuth client error   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-09-17 20:50:21 - In reply to message 9 from Keith Fong
Hello Keith,

I just tried it, and I also got a 403 error code.

This used to work in the past. So something changed.

Anyway, I saw a comment from another developer who mentioned that you also need to register users before getting user details. This is weird because you want to get the user details first.

I plan to contact Polar support tomorrow to check if they can help.

Meanwhile, if you discover more details, just let me know here.

 
  1 - 10   11 - 11