devdigital / identityserver4testserver Goto Github PK
View Code? Open in Web Editor NEWIdentity Server 4 testing helper for .NET Core
License: MIT License
Identity Server 4 testing helper for .NET Core
License: MIT License
Hi @devdigital
I am now contribute a web service which combine mvcclient and identity server.
But I can't do test with two server. for example:
Used httpclient sent request to the client, then client request token from idserver.
My sample code reference this issue:
IdentityServer/IdentityServer4#2861
which use two customize WebApplicationFactory.
The Author of identity server tell me that I can using your project to do that. But I don't know how to do this.Because your sample code in the readme show the client is not match my mvcclient project.
Then I create the xunit prject and reference the IdServer Project rebuild log:
1>------ Rebuild All started: Project: Identity.API, Configuration: Debug Any CPU ------
1>Identity.API -> E:\TFSWorkspace\WorkspaceForIdServer\OpenIdAspNetIdentityAuthorize\Services\Identity\Identity.API\bin\Debug\netcoreapp2.2\Identity.API.dll
1>Identity.API -> E:\TFSWorkspace\WorkspaceForIdServer\OpenIdAspNetIdentityAuthorize\Services\Identity\Identity.API\bin\Debug\netcoreapp2.2\Identity.API.Views.dll
2>------ Rebuild All started: Project: Identity.IntegrationTest, Configuration: Debug Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Authentication.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Authorization" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Hosting" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Hosting.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Http.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Identity" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Mvc" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Mvc.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Mvc.Core" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Mvc.RazorPages" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Mvc.ViewFeatures" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Razor.Runtime" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Routing" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.EntityFrameworkCore" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.EntityFrameworkCore.Relational" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.Configuration.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.Identity.Core" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.Logging.Abstractions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.Options" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
2>Identity.IntegrationTest -> E:\TFSWorkspace\WorkspaceForIdServer\OpenIdAspNetIdentityAuthorize\Services\Identity\Identity.IntegrationTest\bin\Debug\netcoreapp2.2\Identity.IntegrationTest.dll
2>Done building project "Identity.IntegrationTest.csproj".
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
I think it would be really helpful to have some extra sample projects.
For example, it would be nice to have a simple API (as seen here) and then show how IdentityServer4TestServer
can be used, maybe along side WebApplicationFactory
?
A lot of us will be using WebApplicationFactory
already, overriding stuff like ConfigureServices
as seen here. So, examples would help people like me move over to this.
I really just want to be able to have my protected API use the IdentityServer4TestServer
as the authority so I can easily create clients with tokens to test my different endpoints using different scopes/claims.
Nice lib!
Could you consider making IdentityServer4TestServerFactory.GetWebHostBuilder() public or protected? I like the fluent config interface you have here I'd like to use it to build a test server that I can bind to a real listener instead of aspnet core's TestServer (the scenario is a 'DevServer' the runs multiple listeners - IdSrv and my app, amongst others).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.