I want to use forms authentication for an entire web site in EWL. It's just not working.
- I have created a UserManagementProvider which extends FormsAuthCapableUserManagementProvider.
- I have set the root Entity Setup to force there to be an authenticated user (protected override bool UserCanAccessEntitySetup { get { return AppTools.User != null; } })
I have the following implemention of GetShortcutUrlResolvers in Global.asax:
protected override IEnumerable<ShortcutUrlResolver> GetShortcutUrlResolvers() { yield return new ShortcutUrlResolver( "", ConnectionSecurity.SecureIfPossible, () => AppTools.User == null ? null : Pages.Dashboard.GetInfo() ); }
I get an Access Denied exception when visiting the root of the site. If I remove the AppTools.User == null ? null ternary, I get an unhandled exception saying that GetUrl was called for a user that didn't have permission. If I add the shortcut URL only if there is an authenticated user, I get a "This page is no longer available" error because it doesn't know where to send me when I go to the root URL. I am never presented with the login page. What else do I have to do?
Maybe EWL is not picking up your provider. Make sure the class is called
UserManagement
(not UserManagementProvider) and is in theYourLibraryProjectNamespace.Configuration.Providers
namespace.