Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not getting Startup.Auth file

I am trying to install steam login, for my website, BUT after i have done the installation in nuget package manager console, with the following install code: Install-Package Owin.Security.Providers.Steam I am missing my Startup.Auth.cs. What am i doing wrong? The project is started without "Individual User Accounts".

like image 951
Code King Avatar asked May 29 '26 22:05

Code King


1 Answers

The Startup.Auth.cs file should be in your App_Start Folder. Just create a default MVC web application with Individual User Accounts selected as the Authentication type under Change Authentication option to see how its implemented.

For reference:

using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
using Owin.Security.Providers.Steam;

namespace WebApplication
{
    public partial class Startup
    {

        public void ConfigureAuth(IAppBuilder app)
        {
            //other Config

            app.UseSteamAuthentication("your API key");
        }
    }
}

See here for reference on how to add the Steam login button.

Edit: Also see here for Adding MVC 5 Identity to our Existing Project.

You may need to add startup.cs to root of your project:

using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(WebApplication1.Startup))]
namespace WebApplication1
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}
like image 67
James P Avatar answered May 31 '26 11:05

James P



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!