Created
August 27, 2010 06:56
-
-
Save kkozmic/552949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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