0

我需要在两个不同的浏览器(即 Chrome 和 IE)之间维护一个 OpenID 登录。如何才能做到这一点?

我正在使用这段代码:

https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0200_DevKits_for_Intuit_Partner_Platform/0300_Windows_Azure_Program_for_Intuit_Anywhere/0001_Installing_the_Windows_Azure_SDK_2.0_for_Intuit_Anywhere

这是我的代码:

 /// <summary>
    /// Action Result for Index, This flow will create OAuthConsumer Context using Consumer key and Consuler Secret key
    /// obtained when Application is added at intuit workspace. It creates OAuth Session out of OAuthConsumer and Calls 
    /// Intuit Workpsace endpoint for OAuth.
    /// </summary>
    /// <returns>Redirect Result.</returns>
    public RedirectResult Index()
    {
        oauth_callback_url = Request.Url.GetLeftPart(UriPartial.Authority) + ConfigurationManager.AppSettings["oauth_callback_url"];
        consumerKey = ConfigurationManager.AppSettings["consumerKey"];
        consumerSecret = ConfigurationManager.AppSettings["consumerSecret"];
        oauthLink = Constants.OauthEndPoints.IdFedOAuthBaseUrl;
        IToken token = (IToken)Session["requestToken"];
        IOAuthSession session = CreateSession();
        IToken requestToken = session.GetRequestToken();
        Session["requestToken"] = requestToken;
        RequestToken = requestToken.Token;
        TokenSecret = requestToken.TokenSecret;

        oauthLink = Constants.OauthEndPoints.AuthorizeUrl + "?oauth_token=" + RequestToken + "&oauth_callback=" + UriUtility.UrlEncode(oauth_callback_url);
        return Redirect(oauthLink);
    }

<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
<add key="oauth_callback_url" value="/OauthResponse"/>
<add key="menuProxy" value="MenuProxy"/>
<add key="grantUrl" value="OauthGrant"/>
<add key="qbo_base_url" value="https://qbo.intuit.com/qbo1/rest/user/v2/"/>

<!-- Enter the Application Name by replacing YourAppName -->
<add key="openid_identifier" value="https://openid.intuit.com/Identity-YourAppName"/>

4

1 回答 1

4

您需要将 openid 与为该用户获得的 oauth 令牌映射并将其保存在商店中。下次用户登录时,您应该在应用程序中构建逻辑以查找该用户的令牌(基于 openid)。

于 2013-03-01T16:43:38.253 回答