Skip to content

Instantly share code, notes, and snippets.

@ktskumar
Last active July 7, 2023 13:58
Show Gist options
  • Save ktskumar/e36cbca58ce9d539f7f2660f8a30a9e4 to your computer and use it in GitHub Desktop.
Save ktskumar/e36cbca58ce9d539f7f2660f8a30a9e4 to your computer and use it in GitHub Desktop.
Retrieve the Current User information from SharePoint
//getRequest method reference
//https://gist.github.com/ktskumar/a9e9df497673e9fd26ead8532b9ff425
//Returns the current user information
getRequest("https://domain.sharepoint.com/sites/name/_api/web/currentuser").then(function(output){
console.log(JSON.parse(output.response));
});
//Returned Properties
//Email, Expiration, Id, IsEmailAuthenticatonGuestUser, IsHiddenInUI, IsShareByEmailGuestUser, IsSiteAdmin, LoginName,
//PrincipalType, Title, UserId, UserPrincipalName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment