Comments (6)
Are you sure?
from aioauth-client.
yep, https://github.com/klen/aioauth-client/blob/develop/aioauth_client.py#L306-L319 data is not saved anywhere
from aioauth-client.
vk.com passes the email as data['email'] there
from aioauth-client.
As access_token is saved to self.access_token, then may be we could return the whole data
dict? Don't know would it break any existent code, and what about API stability...
from aioauth-client.
I use the following hack to get email for vk:
class VKClient(OAuth2Client):
authorize_url = 'http://api.vkontakte.ru/oauth/authorize'
access_token_url = 'https://api.vkontakte.ru/oauth/access_token'
user_info_url = (
'https://api.vk.com/method/users.get?fields='
'uid,first_name,last_name,nickname,sex,bdate,city,'
'country,timezone,photo_big'
)
name = 'vk'
base_url = 'https://api.vk.com'
@asyncio.coroutine
def get_access_token(self, *args, **kwargs):
ret = yield from super().get_access_token(*args, **kwargs)
if 'email' in ret:
self.email = ret['email']
return ret
@asyncio.coroutine
def user_info(self, **kwargs):
user, data = yield from super().user_info(**kwargs)
if hasattr(self, 'email'):
user.email = self.email
return user, data
@staticmethod
def user_parse(data):
""" Parse information from provider. """
resp = data.get('response', [{}])[0]
yield 'id', resp.get('uid')
yield 'first_name', resp.get('first_name')
yield 'last_name', resp.get('last_name')
yield 'username', resp.get('nickname')
yield 'city', resp.get('city')
yield 'country', resp.get('country')
yield 'picture', resp.get('photo_big')
from aioauth-client.
I think it's a good idea. So I've make decision to return provider's data with the tokens. The client is updated.
Thank you for the feedback.
from aioauth-client.
Related Issues (20)
- Make it possible to use a different access_token in request()
- access_type='offline' and refresh token HOT 1
- Percent encoding HOT 1
- Sending query params with multiple values for the same key HOT 2
- don't raise HTTPBadRequest every time HOT 2
- request always get empty dict HOT 1
- LichessClient throwing AttributeError: 'NoneType' object has no attribute 'get'
- Gitlab oauth2 provider HOT 1
- GitHub example in README.rst seems broken HOT 1
- Example app on localhost failed with SSL error HOT 1
- aiohttp deprecation warnings and unpinned aiohttp package HOT 1
- Non pin based user authentication for Twitter?
- Client credentials grant type support HOT 1
- Undeclared dependency on `yarl` package HOT 1
- sensitive credentials included in debug logs HOT 2
- DiscordClient HOT 4
- In example app Facebook auth not working HOT 5
- Cannot use querystring parameters with TwitterClient HOT 1
- Create a client for discordapp.com HOT 1
- Bitbucket2Client bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aioauth-client.