Django Azure AD get user info - django

I am currently using django-azure-ad-auth package for user authentication purpose. I wanted to retrieve user information too like displayName etc, How do I go about implementing this?

You are using django-azure-ad-auth package which helps only for authentication purposes. You need to use API's likes MS Graph for getting the user information.
To use MS Graph with Python please follow MS document

Related

Django all auth microsoft graph profile picture

I use django-allauth about user registration/login using user's Microsoft Graph profile. Now, I can take some standard information from Microsoft (default for all auth). Is possible to retrieve also list of profile-pictures? How can make it in allAuth?
To retrieve the profile photo of a user:
GET /me/photo/$value
GET /users/{id | userPrincipalName}/photo/$value
AFAIK not sure we can fetch the list of profile photos, for more information please refer to this document:https://learn.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0#to-retrieve-the-profile-photo-of-a-user
Hope this helps.

API to get another user's info?

I went through the Pinterest's developer center and also found a thread from 2016 which mentions that getting another Pinterest user's info (pins, follower count, etc.) is not part of the API. Is that correct? Can someone please confirm.
I also found mentions of V3 Pinterest API, but can't find official documentation for it. How can I get access to the V3 API?
I don't see anything about v3 of the API on their documentation.
But as with most APIs like Pinterest's API, you can only get the user information for the currently authenticated user, not just random users. When they log in using OAuth, they will get a prompt for permission like this image:
So, if your user allows your app to have those permissions you should be able to access the user object which includes a counts property. According to the docs, the counts property includes: "The user’s stats, including how many Pins, follows, boards they have".

How do I get the list of facebook apps a user is an admin of using the Facebook Graph API?

Am using the Facebook Ads API to run ads. For running Mobile App Ads, I need to retrieve the apps which the logged in User is an admin of. I couldn't figure out from the documentation as to how to get this list of apps. Some stack overflow threads (How to get if a user is admin of a page (isAdmin) using the Facebook Graph API?) suggest requesting /me/accounts , but the just returns a list of facebook pages the user is an admin of. Could someone suggest some documentation in this direction?
The Graph API call /me/applications/developer returns all applications of which the user is an admin.
Read more here: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/applications/developer
Doesn’t seem to be possible with the current API v2.0 – but it is with FQL, using the app_role table:
SELECT application_id FROM app_role
WHERE developer_id = me() AND role = 'administrators'
Test it in Graph API Explorer
(And yes, FQL is deprecated, but it will still be around for at least two years. And before they completely shut it off, they will implement query-like features in a future API version according to what I’ve heard from FB employees.)

Linking different user profiles in Google app Engine using python

I am building a social app on Google app engine using python, for which i am using Google+ api for user login and after login user can post and share.I need help in connecting one user profile to another so that user can see others post and follow them and also in displaying one's profile to another user. Like a user can browse public posts of all users, and if he clicks on creator of post, the link should open creator's profile with option of following him.I know to save user data in datastore and retrieve them.
Thanks.
You will probably want to use the Google+ Sign-In, which can get you some information to the social graph and then access to the Google+ API. This information includes the ID of people in the user's circles that they've permitted you to see, so you can use this information to build their social graph.
If you have more specific questions, you should probably update your question (or post a new one) that demonstrates the exact problems you're having with the code.

django facebook app: Testing with Test Users?

I am creating a Facebook App. I would like to test this as real - or real-looking - test users.
How do I do this?
I know that it is possible to create test users via the code, but I have not seen examples of this using Python/Django. I'm also not really sure how to use these test users: can I log in with them for real via Facebook or what?
I would also like for me and a few friends to be able to add the App and test it, but without it being listed in the App Directory (I don't want anyone to stumble across it before it is ready). Is this possible?
Facebook provides an Open Graph API to create test users.
You can view the documentation here:
https://developers.facebook.com/docs/test_users/
How to create a test user (Your first question):
Get an app access token
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
Or use the graph explorer https://developers.facebook.com/tools/explorer/
Or the access token tool: https://developers.facebook.com/tools/access_token/
Create the test user
https://graph.facebook.com/YOUR_APP_ID/accounts/test-users?installed=true&name=YOUR_DESIRED_TEST_USERNAME&permissions=DESIRED_PERMISSIONS_LIST&method=post&access_token=YOUR_APP_ACCESS_TOKEN
Or use the GUI manager for test users on the Open Graph section of your App management dashboard
https://developers.facebook.com/apps/YOUR_APP_ID/permissions
Choose "Add" under Test Users
1) Once you create the test users FB gives you a link you can use to log in, customize profiles and add photos, etc.
2) You can take a look at this CLI written in Python:
https://github.com/kcbanner/facebook-test-users
3) I am not sure, but I think you have a choice of whether to list or not list the facebook app in the directory. You can also limit access to certain users within your code by only allowing certain facebook ids access.