OAuth and 3rd Party Auth: how to get user's username, email and profile info from remote server

Hi, I’m authenticating my users through Microsoft Graph.
At first login, Parse is creating an empty user, with a random username and no useful data.

I need Parse to create the user with more meaningful data, like the real username, email, first and last name.

Is there an easy and clean way to do that?

If not, I’ll neet do add a BeforeSave hook to the user, and make a second call to graph.microsoft.com/v1.0/me, which is the same endpoint that has just been called to validate the session and which returns not only the id (used to validate the authentication) but also the user profile info (username, email, first and last name, etc.).


Yes. I think that would be the best to do. Either a beforeSave or afterSave trigger to grab the information from microsoft’s api and save to the user object.