2012-07-03 88 views
1

我使用來自DotNetOpenAuth.net的示例代碼成爲我自己的OpenID提供程序(OpenIDProviderWebForm)一切正常,我能夠測試我的OP對NerdDinner。現在我想定製標識符--->OpenID提供程序發出的標識符的發現信息不匹配

http://www.mydomain.com/user.aspx/Hash(Username+PrivateKey)~Username

一切工作的OP側,但在NerdDinner範例程序,當應用程序試圖做

HttpRequestInfo clientResponseInfo =新HttpRequestInfo( 「GET」,權威性,auth.PathAndQuery,頭,空);

響應 = RelyingParty.GetResponse(clientResponseInfo);

(你可以找到在AuthController.cs代碼這兩行從的NerdDinner)

響應包含以下錯誤:

The OpenID Provider issued an assertion for an Identifier whose discovery information did not match. 
Assertion endpoint info: 
    ClaimedIdentifier: http://localhost:57571/user.aspx/76208371132EC7F7A37472C8B4CC2CC37A05B707~sohail 
    ProviderLocalIdentifier: http://localhost:57571/user.aspx/76208371132EC7F7A37472C8B4CC2CC37A05B707~sohail   
    ProviderEndpoint: http://localhost:57571/server.aspx 
    OpenID version: 2.0 
    Service Type URIs: 
Discovered endpoint info: [ 
{ 
    ClaimedIdentifier: http://localhost:57571/user.aspx/EA467E35736AC22EB60C04C2E9D9594263B60ECB~sohail  
    ProviderLocalIdentifier: http://localhost:57571/user.aspx/EA467E35736AC22EB60C04C2E9D9594263B60ECB~sohail 
    ProviderEndpoint: http://localhost:57571/server.aspx 
    OpenID version: 2.0 
    Service Type URIs: 
     http://specs.openid.net/auth/2.0/signon 
     http://openid.net/extensions/sreg/1.1 
}, { 
    ClaimedIdentifier: http://localhost:57571/user.aspx/EA467E35736AC22EB60C04C2E9D9594263B60ECB~sohail  
    ProviderLocalIdentifier: http://localhost:57571/user.aspx/EA467E35736AC22EB60C04C2E9D9594263B60ECB~sohail 
    ProviderEndpoint: http://localhost:57571/server.aspx 
    OpenID version: 1.0 
    Service Type URIs: 
     http://openid.net/signon/1.0 
     http://openid.net/extensions/sreg/1.1 
}, 
] 

有人能幫助我嗎?

回答

1

依賴方報告提供者聲明關於標識符的信息,該標識符與OpenID發現產生的關於該相同標識符的信息不匹配。

您作爲提供者的職責包括確保您的斷言符合標識符信息。因此,請考慮錯誤消息中「發現的端點信息」下的內容,以及它與聲明的內容(上面的內容)不同的原因。在這種情況下,您的ClaimedIdentifier和ProviderLocalIdentifier URL在聲明和發現的數據之間是不同的。這可能是因爲斷言標識符上的HTTP GET實際上生成HTTP重定向到「發現的端點信息」下的URL,您需要修復該URL。

+0

謝謝安德魯,有趣的是,當我使用默認格式:(http://www.mydomain.com/user.aspx/Username)。我看到'response = RelyingParty.GetResponse(clientResponseInfo)';'調用server.aspx頁面,但當我將其更改爲自定義格式'response = RelyingParty.GetResponse(clientResponseInfo);'永遠不會調用我的server.aspx頁面。我沒有改變任何東西! – Sohail

+0

我修好了:)再次感謝 – Sohail

相關問題