# 401 Error with Quickstart

**URL:** <https://community.auth0.com/t/401-error-with-quickstart/17245>\
**Category:** Get Help\
**Created:** [October 26, 2018, 5:48am UTC](https://community.auth0.com/t/401-error-with-quickstart/17245 "2018-10-26T05:48:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnjmllr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arnjmllr/32/9439_2.png) [@arnjmllr](https://community.auth0.com/u/arnjmllr)\
**Post date:** [October 26, 2018, 5:48am UTC](https://community.auth0.com/t/401-error-with-quickstart/17245/1 "2018-10-26T05:48:39Z")

</div>

I followed the simple steps but all I get is “this page is not working” 401.

```auto
public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // 1. Add Authentication Services
            services.AddAuthentication(options =>
            {
                options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;

            }).AddJwtBearer(options =>
            {
                options.Authority = "https://amtech.auth0.com/";
                options.Audience = "https://api.alerts.com";
            });

            services.AddAuthorization(options =>
            {
                options.AddPolicy("read:messages", policy => policy.Requirements.Add(new HasScopeRequirement("read:messages", "amtech.auth0.com")));
            });

            // register the scope authorization handler
            services.AddSingleton<IAuthorizationHandler, HasScopeHandler>();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            // 2. Enable authentication middleware
            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
    }

  // GET: api/<controller>
        [HttpGet]
        [Authorize]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

```

Not sure what I’m doing wrong. gotta be something simple. .netcore 2.1

Thanks,

Aaron

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 29, 2018, 4:23pm UTC](https://community.auth0.com/t/401-error-with-quickstart/17245/3 "2018-10-29T16:23:04Z")

</div>

Hey @arnjmllr !

Can you let me know when exactly you get this ‘this page is not working’ error? Have you followed all the steps from this tutorial?

> **[Auth0 ASP.NET Core MVC SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/aspnet-core/01-login)**
>
> This tutorial demonstrates how to add user login to an ASP.NET Core application.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 6, 2018, 12:34pm UTC](https://community.auth0.com/t/401-error-with-quickstart/17245/4 "2018-11-06T12:34:01Z")

</div>

Hey there @arnjmllr!

Have you been able to solve the issue recently? If it’s still there can you provide me with the info I asked you above, so I can help you with it.

Thanks!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 10, 2018, 1:29pm UTC](https://community.auth0.com/t/401-error-with-quickstart/17245/5 "2018-12-10T13:29:47Z")

</div>


