IdentityServer3.Contrib.AccessTokenValidation不适用于IdentityServer3 Owin 4 MVC Framework4.6

问题描述

我的应用是n层的,并且MVC proj与同一解决方案中的多个API项目集成在一起,因此 我已经实现了UseOpenIdConnectAuthentication(可通过Cookies auth使用),现在我想通过Owin 4(IDS 3.8)实现UseIdentityServerBearerTokenAuthentication。 我在MVC项目中有带有前缀office的控制器,在API项目中有带有前缀mapper的控制器,因此外部设备将这些端点作为localhost:4213 / office和localhost:4213 / mapper命中 但是,我已经在Web项目启动中编写了这部分代码(API没有启动),并安装了IdentityServer3.Contrib.AccessTokenValidation“ version =” 4.0.26“。

    app.Map("/api",inner =>
    {  
        var bearerTokenOptions = new IdentityServerBearerTokenAuthenticationOptions
        {
            Authority = ConfigurationManager.AppSettings["##"] + TokenEndpoint,RequiredScopes = new[] { ConfigurationManager.AppSettings["##"] }
            Address = ConfigurationManager.AppSettings["IdentityServer.Url"] + Introspect,Token = token,ClientSecret = ConfigurationManager.AppSettings["###"],ClientId = ConfigurationManager.AppSettings["###"]
        };

        inner.UseIdentityServerBearerTokenAuthentication(bearerTokenOptions);
        var config = new HttpConfiguration();
        config.MapHttpAttributeRoutes();
        
    });

OWIN KATANA日志已打开,但是运行我的应用程序时,调试器碰到了这段代码,它只是卡住了,什么也没发生,在输出窗口中什么也没有,我正在使用此IdentityServer3.AccessTokenValidation,但是由于兼容性问题,我切换到IdentityServer3.Contrib.AccessTokenValidation,但不确定为什么会卡住,并且也没有任何错误。请提供一些示例或一些建议来解决这个问题,我对此非常棘手,没有任何想法。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...