I have a visual studio project using standard .Net Framework (v 4.5). It has authentication using Forms Authentication with a token issued using Oauth 2.0 on another signin-site.
It works well, both on localhost and on a website published in Azure.
Now I want to re-implement this website using .NET Core. Now I need to configure Forms Authentication in a .NET Core 2.0 project. How do I do that?
Details
When I created my "ASP.NET Core Web Application" it came without a web.config. So I manually added a web.config file and added the sections about forms authentication. ( I copied them from the old project).
It looks something like this:
<system.web><sessionState cookieName="Trunk_MyCompany_SessionId" timeout="7" cookieless="false" /><machineKey validationKey="327E43....35E199B14" validation="SHA1" /><authentication mode="Forms"><forms cookieless="UseCookies" protection="All" name=".trunk.MyCompany-Auth" domain="" slidingExpiration="true" timeout="7" /></authentication><httpModules><add name="AuthenticationModule" type="MyCompany.Auth.AuthenticationModule, MyCompany.Auth" /></httpModules></system.web><system.webServer><validation validateIntegratedModeConfiguration="false" /><modules><add name="AuthenticationModule" type="MyCompany.Auth.AuthenticationModule, MyCompany.Auth" preCondition="managedHandler" /></modules></system.webServer>
Nothing different happens when I am adding this. My guess is that the website never reads this.
The project has a file called "launchSettings.json". It contains
{"iisSettings": {"windowsAuthentication": false,"anonymousAuthentication": true,"iisExpress": {"applicationUrl": "http://localhost:49952/","sslPort": 0 } ...
Maybe I should change something here?
Vilhelm Heiberg, ExorLive AS