Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created August 27, 2010 06:56
Show Gist options
  • Save kkozmic/552949 to your computer and use it in GitHub Desktop.
Save kkozmic/552949 to your computer and use it in GitHub Desktop.
public ActionResult TryAuth(string openid_identifier)
{
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if(response== null)
{
var req = openid.CreateRequest(openid_identifier);
req.AddExtension(new ClaimsRequest
{
Email = DemandLevel.Require,
Nickname = DemandLevel.Require
});
return req.RedirectingResponse.AsActionResult();
}
switch(response.Status)
{
case AuthenticationStatus.Authenticated:
{
var data = response.GetExtension(typeof(ClaimsResponse)) as ClaimsResponse;
// data is null here <-----------------------------------------------------------------------------------------
return View("Index");
}
}
return View("Index");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment