Error using rauth in the application engine (Permission denied)

I have an app for app app using oauth and rauth , I am trying to use Facebook, Twitter and Google to login.

When I run it locally, but in the production process I got this error, but only with google plus, it works fine with facebook.

('Connection aborted.', Error (13, โ€œAccess deniedโ€)) Traceback (last last call): File โ€œ/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/ webapp2.py ", line 1535, into the call rv = self.handle_exception (request, response, e) File" /base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py ", line 1529, to the call rv = self.router.dispatch (request, response) File" /base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py ", line 1278, in default_dispatcher return route.handler_adapter (request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, to the call return handler .dispatch () File "/base/data/home/apps/s~app-getwell/login:1.379942143707124 638 / handler.py ", line 11, when sending webapp2.RequestHandler.dispatch (I) File" /base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py ", line 572, when sending return self.handle_exception (e, self.app.debug) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570 , when sending the return method (* args, ** kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/loginToken.py", line 69, in ep = log.getTokenData (code ) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/conect.py", line 34, in getTokenData session = self.getSession (conf, code) File "/ base /data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/conect.py ", line 61, in getSession session = conf.get_auth_session (data = self.ge tData (code), decoder = json.loads) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/service.py", line 556, in get_auth_session session = self.get_session (self.get_access_token (method, ** kwargs)) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/service.py", line 541, in get_access_token r = self.get_raw_access_token (method, ** kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/service.py", line 518, in get_raw_access_token ** kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/session.py", line 358, in the request return super (OAuth2Session, self). request (method, url, ** req_kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/requests/sessions.py", line 457, in the request resp = self.send (prep, ** send_kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/requests/sessions.py", line 569, in the message r = .send adapter (request, ** kwargs) File "/base/data/home/apps/s~app-getwell/login:1.379942143707124638/code/oauth/rauth/requests/adapters.py", line 407, in message Raise ConnectionError (err, request = request) ConnectionError: ('Connection aborted.', Error (13, 'Permission denied'))

I have billing enabled, and the ssl library (latests) has been added to yaml

This is the code in which I make oauth calls

class login(): def __init__(self,tipo=tipoConexion.Google, redirect_uri = 'http://map.getwell.care/'): self.__tipo=tipo self.config=config.data(redirect_uri) def getAuthorizationURL(self): conf=self.getConfig() params=self.getParams() url = conf.get_authorize_url(**params) return url def getTokenData(self, code): ''' Get the data that i need from the provider ''' conf=self.getConfig() session = self.getSession(conf,code) tokenizerConcreto=JsonReader.factory(self.__tipo,session) email=tokenizerConcreto.getEmail()[0] urlPic=tokenizerConcreto.getPicture()[0] logueado=not tokenizerConcreto.getEmail()[1] return logueado, urlPic, email def getParams(self): params=None if self.__tipo==tipoConexion.Google: params = self.config.GooglePlusScope if self.__tipo==tipoConexion.Facebook: params = self.config.FacebookScope return params def getConfig(self): conf=self.config.googlePlus if self.__tipo==tipoConexion.Facebook: conf=self.config.facebook if self.__tipo==tipoConexion.Twitter: conf=self.config.twitter return conf def getSession(self,conf, code): session=None if self.__tipo==tipoConexion.Google: session=conf.get_auth_session(data=self.getData(code), decoder=json.loads) else: session=conf.get_auth_session(data=self.getData(code)) return session def getData(self,code): data=None if self.__tipo==tipoConexion.Google: data={ 'code' : code, 'redirect_uri': self.config.redirect_uri, 'grant_type':'authorization_code' }# logging.info("GetWell: Data previo al error: %s" % data) if self.__tipo==tipoConexion.Facebook: data={ 'code' : code, 'redirect_uri': self.config.redirect_uri, } if self.__tipo==tipoConexion.Twitter: raise NotImplementedError return data 

and this is the code when I received the keys of secrets

 class tipoConexion(): Google=0 Facebook=1 Twitter=2 class data(object): def __init__(self, url = 'http://map.getwell.care/'): self.redirect_uri=url def getURL(self): return self.redirect_uri @property def twitter(self): return OAuth1Service( consumer_key='imnotatwitterman', consumer_secret='ilovevine', name='twitter', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authorize', request_token_url='https://api.twitter.com/oauth/request_token', base_url='https://api.twitter.com/1/') @property def facebook(self): return OAuth2Service( client_id='someID', client_secret='MyDarkSecretInFacebook', name='facebook', authorize_url='https://graph.facebook.com/oauth/authorize', access_token_url='https://graph.facebook.com/oauth/access_token', base_url='https://graph.facebook.com/') @property def FacebookScope(self): return { 'scope': 'public_profile,email', 'response_type': 'code', 'redirect_uri': self.getURL() } @property def googlePlus(self): return OAuth2Service( client_id='ThisCouldBeMyID.apps.googleusercontent.com', client_secret='Idonthaveanysecrets', name='googlePlus', authorize_url='https://accounts.google.com/o/oauth2/auth', access_token_url='https://accounts.google.com/o/oauth2/token', base_url='https://accounts.google.com/o/oauth2/auth') @property def GooglePlusScope(self): return { 'scope': 'https://www.googleapis.com/auth/plus.profile.emails.read', 'response_type': 'code', 'redirect_uri': self.getURL() } 

since I said the strangest thing is that it works fine with facebook, but with an error with google plus (I do a client_id and client_secret check and it is correct), if this is a problem with sockets, facebook should also crash

ps. I copy rauth files in my project and request files inside rauth folder

+5
source share

Source: https://habr.com/ru/post/1206470/


All Articles