【问题标题】:Integration testing with IdentityServerAuthentication IdentityServer4使用 IdentityServerAuthentication IdentityServer4 进行集成测试
【发布时间】:2017-01-10 21:58:06
【问题描述】:

就像这个问题“Integration testing with in-memory IdentityServer”一样,我想对我的 IdentityServer4 实现进行一些集成测试。

我已经按照本教程 IDENTITYSERVER4, WEB API AND ANGULAR2 IN A SINGLE ASP.NET CORE PROJECT 添加了一个 API,用于管理与我的 IdentityServer4 相同的项目中的用户。

但集成测试失败,因为 IdentityServer 尝试使用 HTTP 请求调用 discoveryEndpoint。

所以在这个问题“Integration testing with in-memory IdentityServer”@emedbo 中创建了一个 FakeAccessTokenValidation,但我不知道该怎么做。

谢谢。

【问题讨论】:

    标签: c# asp.net-core-1.0 identityserver4


    【解决方案1】:

    在阅读 ASP.Net 核心身份代码的帮助下,我调整了一个中间件,无需身份验证即可伪造用户。

    更多关于这个 github repo https://github.com/waldo2188/fake-authentication-jwtbearer

    【讨论】:

    • 完美,正是我所需要的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-07
    • 2019-12-17
    • 2015-12-28
    • 2020-05-26
    • 2018-01-02
    • 2021-02-03
    • 2015-06-14
    相关资源
    最近更新 更多