I'm trying to implement Oauth2 authorization using Rauth for vk.com provider and I have the following issue:
As far as I know there is no way to obtain users email address through vk.com api call, but it sends email address with access_token in json format.
My problem is: I do not know how to obtain it from Rauth's "session" object, there is an access_token field but no way to get an email address.
Here is the code:
def callback(self):
def decode_json(payload):
return json.loads(payload.decode('utf-8'))
if 'code' not in request.args:
return None, None, None
oauth_session = self.service.get_auth_session(
data={'code': request.args['code'],
'grant_type': 'authorization_code',
'redirect_uri': self.get_callback_url()},
decoder=decode_json
)
me = oauth_session.get("some call to vk.api").json()
Thank you for your help!