2015-10-05 63 views
0

我在登錄Sitecore時遇到了問題(後臺)即使憑據正確,我仍然在相同的登錄頁面上重定向。登錄Sitecore時發生問題

調試時,我發現,當在登錄過程中,用戶會被重定向到http://hostname/sitecore/shell/Applications/Login/Users/Users.aspx?su=%2Fsitecore%2Fshell%2Fdefault.aspx%3Fsc_lang%3Den

但是一旦有出現跌破發行: Sitecore.Context.User.IsAuthenticated設置爲false Sitecore.Context.User設置爲Sitecore /匿名

但是,用戶已註冊並且已成功創建故障單。我可以通過調試和檢查cookie來驗證。

回答

0

更多的調查之後,我發現這個問題是通過添加以下線路上的global.asax.cs

public void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs args) 
    { 
     string frameworkVersion = this.GetFrameworkVersion(); 
     if (!string.IsNullOrEmpty(frameworkVersion) && frameworkVersion.StartsWith("v4.", StringComparison.InvariantCultureIgnoreCase)) 
     { 
      args.User = SC.Context.User; 
     } 
    } 

解決它設置用戶到正確的用戶,而不是Sitecore的\匿名。