locked
How To get SharePoint logedin user email in provider hosted app RRS feed

  • Question

  • Hi

    I am using Amazon cloud to host my provider hosted app. App is developed using chrome control and app is registered in SharePoint Online.

    can any one explain how to get email Id of logged in user in SharePoint online from provider hosted App.

    Regards
    Kaps

    Saturday, September 6, 2014 7:32 PM

Answers

  • Hi,

    Please refer to the following article it has complete information how to get user details.

    How to: Get user identity and properties in SharePoint 2013

    Using PeopleManager, we can get the emailID.

    PeopleManager peopleManager = new PeopleManager(clientContext);
    PersonProperties personDetails = peopleManager.GetMyProperties();
    clientContext.Load(personDetails, personsD => personsD.AccountName, personsD => personsD.Email,  personsD => personsD.DisplayName);
                    clientContext.ExecuteQuery();
    

    Please mark it answered, if your problem resolved.

    • Marked as answer by Patrick_Liang Friday, September 12, 2014 10:24 AM
    Sunday, September 7, 2014 8:00 AM