使用identityserver4授权.net web api应用程序

问题描述 投票:0回答:1

我有基于身份服务器4的身份服务器我有.net核心api,它使用来自IS的access_token成功授权但是,非核心webapi返回未授权的请求,用于标记有Authorize属性的控制器

API启动类:公共类Startup {public void Configuration(IAppBuilder app){

        app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
        {
            Authority = "http://localhost:5000",
            ValidationMode = ValidationMode.Both,
           RequiredScopes = new[] { "ofd" },

        });


    }
}

我错过了什么?

asp.net-web-api identityserver4 identityserver3
1个回答
0
投票
<add key="owin:AutomaticStartup" value="true"/> 

在web.config / appSettings中错过了,并且owin中间件没有启动

© www.soinside.com 2019 - 2024. All rights reserved.