2016-03-23 44 views
0

由於某些原因,我無法設置EntityDescriptor並返回null。SSO SAML 2.0 - EntityDescriptor返回null

EntityDescriptor metadata = null; 
metadata = (EntityDescriptor)context.Cache['https://domain.info/blah']; 

這個EntityDescriptor是實例化一個SAML 2.0 Assertion Consumer Factory所需的。任何洞察力將不勝感激。

+0

看起來像'context.Cache ['https://domain.info/blah']'返回null。 –

+0

正確。我正在試圖確定它爲什麼返回null而不返回這個EntiryDescriptor。 – 80sRocker

+0

從你在這裏提供的代碼,沒有辦法找出原因。你需要更具體。包含關於context.Cache ['https://domain.info/blah']'設置的代碼和信息。 –

回答

0

我無法獲取當前應用程序域的Cache對象,因爲它無法找到它並返回null。這是因爲Uri與Web.Config中元數據項鍵值的大小寫不匹配。胃內<add key="https://Domain.Info/Blah" metapath="c:\saml\meta\blah_samlMeta.xml" metauri="https://domain.info/blah" />將鍵值更改爲小寫爲我工作。