I am in the process of setting up SSO for a legacy WebForms 4.61 application with a newly minted MVC application. Following along using the references cited in this original SO Post.
The web.config in the WebForms app looks as follows:
<authentication mode="Forms">
<forms loginUrl="~/account/login" timeout="120" defaultUrl="~/" />
</authentication>
<roleManager enabled="true" defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<httpRuntime targetFramework="4.6.1" maxRequestLength="20480" requestValidationMode="2.0" executionTimeout="300" />
I can log in and all is as expected. Now however I want to add the following machineKey configuration:
<machineKey decryptionKey="AutoGenerate" validation="SHA1" validationKey="AutoGenerate" />
to replace what is default behaviour (when nothing is specified) of:
<machineKey decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" validationKey="AutoGenerate,IsolateApps" />
However as soon as I add the machineKey entry to the web.config and re-run the application up I can no longer log in. I am using a standard asp:Login control to do the authentication.
Why does authentication stop working as soon as I add the machineKey?
PS. Specifying a decryptKey and validationKey makes no difference to the behaviour, I cannot log in.