簡體   English   中英

聯合身份令牌復制字符以關閉標簽(cookie)(使用Thinktecture Identity Server)

[英]Federated Identity Token duplicating characters for closing tags (cookies) (using Thinktecture Identity Server)

使用正在設置的cookie遇到一個奇怪的問題。 在大多數情況下,一切都按預期工作,但有時我得到錯誤

System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. 
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at System.IdentityModel.Services.ChunkedCookieHandler.ReadInternal(String name, HttpCookieCollection requestCookies)
at System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken& sessionToken)
at System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

我可以一遍又一遍地執行相同的步驟,此錯誤將隨機顯示。 也許在5日去,然后第10次去下一次。

當我在瀏覽器中查看cookie時,我可以看到發生錯誤時結束標記的最后幾個字符是重復的。 Cookies如下(重要位),

FedAuth={base64string}
FedAuth1={base64string}cml0eUNvbnRleHRUb2tlbj4=
FedAuth2=b2tlbj4=

注意FedAuth1如何完成FedAuth2的字符。 由於某種原因,這個FedAuth2 cookie被不必要地創建並導致字符串結束

</SecurityContextToken>oken>

(base64解密)。

我不知所措......

我仍然不確定為什么會這樣,但我設法通過重命名我的一些角色來解決問題,所以cookie永遠不會超過2個FedAuth cookie。 問題似乎是創建了第三個cookie。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM