Skip to content

Instantly share code, notes, and snippets.

@martinnormark
Created January 16, 2015 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinnormark/beb851d1af169fcbb89e to your computer and use it in GitHub Desktop.
Save martinnormark/beb851d1af169fcbb89e to your computer and use it in GitHub Desktop.
public static async Task<ZuMoLoginProviderCredentials> GetCurrentUser(this ApiController controller)
{
ServiceUser serviceUser = controller.User as ServiceUser;
if (serviceUser != null)
{
var identity = await serviceUser.GetIdentitiesAsync();
var credentials = identity.OfType<ZuMoLoginProviderCredentials>().FirstOrDefault();
return credentials;
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment