Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 20, 2012 22:08
Show Gist options
  • Save sandrinodimattia/3153597 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3153597 to your computer and use it in GitHub Desktop.
Return Photo Result
public ActionResult Photo()
{
var photo = GetClaims().FirstOrDefault(o => o.ClaimType == "be:fedict:eid:idp:photo");
if (photo != null)
{
var stream = new MemoryStream(Convert.FromBase64String(photo.Value));
return new FileStreamResult(stream, "image/jpg");
}
else
{
return new EmptyResult();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment