PythonAnywhere Forums

Whitelist Suggestion: LinkedIn

We are working on getting a research study set up. Part of the protocol is asking for permission to access some data using the LinkedIn API. I'm running into the following error:

HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/oauth2/accessToken?grant_type=authorization_code&code=&redirect_uri=http://<user>.pythonanywhere.com/survey/linkedin/token/&client_id=<code>&client_secret=<code> (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

Looking through the forums it looks like this might be a whitelist issue? (https://www.pythonanywhere.com/forums/topic/1860/). If it makes any difference, right now we are on a free account to test things and make sure we can get everything working. If we can get this kink ironed out we plan on moving up to a pay to play account.

Thanks!

Hi cjohns,

I just checked and we already have api.linkedin.com whitelisted (but not the whole linkedin.com). You can see all our whitelisted sites here. Would you be able to modify your linkedin api call so that it accesses the actual api? If parts of the linkedin api does require calls to linkedin.com, point us to a link/reference and we can add that to the whitelist for you.

Alternatively you could try to upgrade your account to a paying account, in which case you would get unrestricted internet access. Unfortunately we are not able to allow unpaid accounts unrestricted access because it has been abused and used for malicious intents in the past.

Conrad

Hi Conrad,

I think that should do the trick but if for some reason it doesn't I'll post back and you can remove it.

Craig

Hi Conrad,

Sorry, had you already whitelisted the .com or is that in the works? I'm still receiving the error and I want to make sure I'm debugging the right thing.

Thanks!

Craig

We already have api.linkedin.com whitelisted because that's where the API for linkedin is. We have no plans to whitelist www.linkedin.com.

Hey guys,

I upgraded my account to see if that made a difference and it's still a no go. If you look at the authentication documentation in order to hook into the linkedin API you must first ask for access which uses linkedin.com.

https://developer.linkedin.com/documents/authentication

Step 3. Get an access token Access token is unique to a user and an API Key. You need access tokens in order to make API calls to LinkedIn on behalf of the user who authorized your application. The first step is asking the user to grant access with the LinkedIn authorization dialog.

a. Generate Authorization Code by redirecting user to LinkedIn's authorization dialog

https://www.linkedin.com/uas/oauth2/authorization?response_type=code &client_id=YOUR_API_KEY &scope=SCOPE &state=STATE &redirect_uri=YOUR_REDIRECT_URI

I'm unable to redirect to the dialog because of the issue above or at least that what I think the issue is. If we can iron out the issue great, if it's not going to be possible do to technical constraints that's fine, I just need to know so I can look for another solution.

Thanks!

After you upgraded, did you start a new console or reload your web app?

Hi Glenn,

I just reloaded the website in on the dashboard and we appear to be good to go. Thanks for the suggestions and the help!

Craig

Guys, I am new on Python, so I am not a great source of information, but I know a particularity about Linkedin's API: you can shot ONLY ONE REQUEST A DAY, for each autorized account. So, after first request, you have to wait 24 hours to request again.

Best regards, Miro.

Hi, I'm having the same issue, where the host in my error is 'api.clarifai.com'. Is it possible to get api.clarifai.com whitelisted?

Thanks in advance!

Cool. I've added that to the whitelist.

Hi guys, i am having the same issue with: host='onesignal.com', port=443. Is it possible to add 'onesignal.com' to the whitelist?

Thanks in advance. Have a nice day.

Sure! That's been added.

Hi guys, I am facing issue with - ProxyError: HTTPSConnectionPool(host='gateway-a.watsonplatform.net', port=443): Max retries exceeded with url. (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',))). Is it possible to add 'gateway-a.watsonplatform.net' to whitelist? Thanks.

Almost certainly -- I'm guessing that it's part of IBM's Watson system? What we need is a link to the API docs saying what the domains that it uses are -- I'm guessing there might be gateway-b and so on as well, so we should get all of them.

Yes, its a part of IBM's watson system. I am calling their visual recognition api. They have mentioned API endpoint as https://gateway-a.watsonplatform.net/visual-recognition/api.

You can find the API docs on the following links:

https://www.ibm.com/watson/developercloud/visual-recognition/api/v3/?curl#introduction

https://www.ibm.com/watson/developercloud/doc/visual-recognition/index.html

Hi there, I've added gateway-a now. Let us know if it works OK?

Hello, one more Api: https://min-api.cryptocompare.com Add to white list, please

Thank you!

Ok, have added that now, let us know if it works ok.

Hi Harry,

Yes, its working now.

Thank you.

Hi there, for a research study I try to set up a web crawler to scrap prices on e-commerce sites. Therefore I want to access 5 products on 10 different e-commerce sites. While trying to access the first site I run into the following error message

requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.digitec.ch', port=443): Max retries exceeded with url: /de/s1/product/xtorm-xb102-free-15000mah-powerbank-2751059 (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

I am curious whether the issue can be solved with white listing the page(s), upgrading to a hacker account or whether the reason is based on the site blocking amazon aws ips? The e-commerce sites are the following: www.digitec.ch, www.amazon.de, www.brack.ch, www.microspot.ch, www.toppreise.ch, www.pc-ostschweiz.ch, www.techmania.ch, www.steg-electronics.ch, www.conrad.ch. Thank you in advance for your help.

ps: I am new to coding. And for testing I am using a free account with the intention to move up to a hacker account.

external internet access for free accounts is restricted to a whitelist. the 403 forbidden message is what results when trying to access something outside of the whitelist. (upgrading will help- any new consoles you start won't have to go through the proxy)