Telling me to remove EPiServer.Cms.UI.AspNetIdentity.dll. If I remove it, my project wont compile. If I remove these: EPiServer.Cms.Shell.UI.dll EPiServer.UI.dll EPiServer.Shell.UI.dll EPiServer.Shell.dll
It fails because EPiServer.Cms.UI.AspNetIdentity.dll requires them.
Maybe you cant use EPiServer.Cms.UI.AspNetIdentity.dll in the Commerce Manager?
The Login.aspx.cs looks like this:
using Designonline.Shared.Identity;
using EPiServer.Cms.UI.AspNetIdentity;
using Microsoft.AspNet.Identity.Owin;
using System;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Designonline.Manager
{
///
/// This is a custom code behind for the login page for CommerceManager
/// to get OWIN authentication.
///
///
/// We replace the original one as a build step when building this project.
/// See the AfterBuild msbuild target in this files project file for details
/// on how that is done.
///
public partial class Login : Page
{
private const string UserLoginFailureMessage = "Login failed. Please try again.";
private ApplicationSignInManager _signInManager;
protected void Page_Load(object sender, EventArgs e)
{
Page.Header.DataBind();
_signInManager = Request.GetOwinContext().Get>();
LoginCtrl.Authenticate += LoginCtrl_Authenticate;
if (IsPostBack)
{
return;
}
LoginCtrl.FindControl("ApplicationRow").Visible = Mediachase.Commerce.Core.AppContext.Current.GetApplicationDto().Application.Count != 1;
LoginCtrl.Focus();
}
protected void LoginCtrl_Authenticate(object sender, AuthenticateEventArgs e)
{
var userName = ((TextBox)LoginCtrl.FindControl("UserName")).Text;
var password = ((TextBox)LoginCtrl.FindControl("Password")).Text;
var remember = ((CheckBox)LoginCtrl.FindControl("RememberMe")).Checked;
var validated = _signInManager.PasswordSignInAsync(userName, password, remember, false).Result == SignInStatus.Success;
if (validated)
{
HandleLoginSuccess(userName, remember);
}
else
{
HandleLoginFailure(UserLoginFailureMessage);
}
}
private void HandleLoginSuccess(string userName, bool remember)
{
string url = FormsAuthentication.GetRedirectUrl(userName, remember);
if (url.Equals(FormsAuthentication.DefaultUrl, StringComparison.OrdinalIgnoreCase) ||
url.Contains(".axd") ||
url.Contains("/Apps/Core/Controls/Uploader/"))
{
url = "~/Apps/Shell/Pages/default.aspx";
}
Response.Redirect(url);
}
private void HandleLoginFailure(string pageMessage)
{
LoginCtrl.FailureText = pageMessage;
}
}
}
Hi!
We upgraded Commerce to 11.4 and implemented EPiServer.Cms.UI.AspNetIdentity on the login page.
That gave us this exception:
I then fond this article:
https://episerver.zendesk.com/hc/en-us/articles/115004119606-Shell-Initialization-Errors-in-Commerce-Manager-When-Updated-to-v10
Telling me to remove EPiServer.Cms.UI.AspNetIdentity.dll. If I remove it, my project wont compile. If I remove these:
EPiServer.Cms.Shell.UI.dll
EPiServer.UI.dll
EPiServer.Shell.UI.dll
EPiServer.Shell.dll
It fails because EPiServer.Cms.UI.AspNetIdentity.dll requires them.
Maybe you cant use EPiServer.Cms.UI.AspNetIdentity.dll in the Commerce Manager?
The Login.aspx.cs looks like this:
Thanks!
/Kristoffer