Linkedin is doing a google cloud / App Engine block

浪尽此生 提交于 2019-12-13 07:16:32

问题


I'm trying to login using LinkedIn on my site on Google App Engine. It was all working until today. Now I get a request denied error when trying to login using Linkedin. It works on the local server, it does not work on App Engine.

I'm using a boilerplate on Googles App Engine platform. I did not write this code but it has not changed so I don't think it is the code.

HTTP/1.1" 999
Error 500: No JSON object could be decoded


    elif provider_name == "linkedin":
        callback_url = "%s/social_login/%s/complete" % (self.request.host_url, provider_name)
        authentication = linkedin.LinkedInAuthentication(
            self.app.config.get('linkedin_api'),
            self.app.config.get('linkedin_secret'),
            callback_url,
            [linkedin.PERMISSIONS.BASIC_PROFILE, linkedin.PERMISSIONS.EMAIL_ADDRESS])
        authentication.authorization_code = self.request.get('code')
        access_token = authentication.get_access_token()
        link = linkedin.LinkedInApplication(authentication)
        u_data = link.get_profile(selectors=['id', 'first-name', 'last-name', 'email-address'])
        user_data = {
            'first_name': u_data.get('firstName'),
            'last_name': u_data.get('lastName'),
            'id': u_data.get('id'),
            'email': u_data.get('emailAddress')}
        self.session['linkedin'] = json.dumps(user_data)

来源:https://stackoverflow.com/questions/33181432/linkedin-is-doing-a-google-cloud-app-engine-block

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!