A python package that helps getting the user info from social apps
Project description
Social User Info
A python package that helps to get the user info from social apps
Installation
Required Python Version >= 3
pip install social-user-info
Supported Social Media
- Github
- Microsoft
How it works?
The package has a method APIService.get_user_info(access_token, auth_source)
.
This method accepts the access_token and auth_source and returns the user info corresponding to the given access token
Usage
Get your google access token:
- Navigate to: https://developers.google.com/oauthplayground/
- In Step 1, select Google OAuth2 API v2 and add
https://www.googleapis.com/auth/userinfo.email
andhttps://www.googleapis.com/auth/userinfo.profile
. Click on Authorize APIs - Login/Select the account you want the access token of
- In Step 2, Click on Exchange Authorization Code for Tokens
- Get the
access_token
from the returned JSON
Get your facebook access token
- Read through this: https://developers.facebook.com/docs/facebook-login/access-tokens/
Get your github access token
- Login to your github account
- Navigate to settings
- Navigate to developer settings at the bottom left
- Navigate to personal access token
- Generate a new Token
- Get the
access_token
by clicking on Generate Token
Get your microsoft access token
- Navigate to https://developer.microsoft.com/en-us/graph/graph-explorer
- Authorize with your microsoft account and give permission to read users
- Select the
Access Token
Tab and copy the access token
Obtain user info
from social_user_info.social_user_info import APIService
APIService.get_user_info(access_token={access_token_from_above_step}, auth_source='google')
APIService.get_user_info(access_token={access_token_obtained_from_facebook}, auth_source='facebook')
APIService.get_user_info(access_token={access_token_obtained_from_github}, auth_source='github')
APIService.get_user_info(access_token={access_token_obtained_from_microsoft}, auth_source='microsoft')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
social-user-info-1.1.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for social_user_info-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 356565f694b33714d6a2f70cfb64639c5fb71cb5fd82044ff3a96553d2e641e0 |
|
MD5 | 385008d6534ef951bc68b361ce5bffb2 |
|
BLAKE2b-256 | cf7603a527714fe0f5ebcff40290ea63e03fa82beb0d9c442bdf835dd5ca0c42 |