Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created June 21, 2012 08:25
Show Gist options
  • Save sandrinodimattia/2964576 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/2964576 to your computer and use it in GitHub Desktop.
Rendering e-Contract photo
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