IdentityServer / IdentityServer4.AccessTokenValidation

IdentityServer Access Token Validation for ASP.NET Core
Apache License 2.0
544 stars 214 forks source link

IdentityServerAuthenticationDefaults seems to be not found #82

Closed createroftheearth closed 7 years ago

createroftheearth commented 7 years ago

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;

namespace OrangeStacksApi
{
    public class Startup
    {
        public void ConfigureServices(
            IServiceCollection services)
        {
            services.AddAuthentication(
               IdentityServerAuthenticationDefaults.JwtAuthenticationScheme)
                    .AddIdentityServerAuthentication(options =>
                    {
                        options.Authority = "http://localhost:5000"; // Auth Server
                        options.RequireHttpsMetadata = false; // only for development
                        options.ApiName = "fiver_auth_api"; // API Resource Id
                    });

            services.AddMvc();
        }

        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env)
        {
            app.UseAuthentication();
            app.UseMvcWithDefaultRoute();
        }
    }
}```

This Startup Class is on API project 
This code seems to be not working because the `IdentityServerAuthenticationDefaults` does not exists in current Context
leastprivilege commented 7 years ago

see here https://github.com/IdentityServer/IdentityServer4.Samples/blob/dev/Clients/src/SampleApi/Startup.cs#L23

leastprivilege commented 7 years ago

Final version has been released now.