相关疑难解决方法(0)

DotNetOpenAuth:邮件签名不正确

尝试使用MyOpenID和Yahoo进行身份验证时,我收到"消息签名不正确"异常.

我几乎使用了DotNetOpenAuth 3.4.2附带的ASP.NET MVC示例代码

public ActionResult Authenticate(string openid)
{
    var openIdRelyingParty = new OpenIdRelyingParty();
    var authenticationResponse = openIdRelyingParty.GetResponse();

    if (authenticationResponse == null)
    {
        // Stage 2: User submitting identifier
        Identifier identifier;

        if (Identifier.TryParse(openid, out identifier))
        {
            var realm = new Realm(Request.Url.Root() + "openid");
            var authenticationRequest = openIdRelyingParty.CreateRequest(openid, realm);
            authenticationRequest.RedirectToProvider();
        }
        else
        {
            return RedirectToAction("login", "home");
        }
    }
    else
    {
        // Stage 3: OpenID provider sending assertion response
        switch (authenticationResponse.Status)
        {
            case AuthenticationStatus.Authenticated:
            {
                // TODO
            }
            case AuthenticationStatus.Failed:
            {
                throw …
Run Code Online (Sandbox Code Playgroud)

openid yahoo asp.net-mvc dotnetopenauth

10
推荐指数
2
解决办法
3374
查看次数

标签 统计

asp.net-mvc ×1

dotnetopenauth ×1

openid ×1

yahoo ×1