IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Question: How to integration test IdentityServer?

Open vsamma opened this issue 9 years ago • 3 comments

Hi,

Wouldn't want to spam the issue list, but thought it's a bit better place to ask for advice specifically for IdentityServer4 than StackOverflow. And I hope it might help someone in the future.

I am implementing IdentityServer4 for my business case where I initially want to set up authentication and authorization for a public API access. For that I will be initially using only ClientCredentials flow. For manually testing the usage flow and correct configuration and setup, I have created a small test API and a Client console app as in the sample projects from the documentation. But I want to automate it as I have almost completed the IdentityServer4 setup and am going to start working on the actual API itself.

So basically I want to do some integration testing against my implementation of the IdentityServer. But I have minimal experience regarding this topic so maybe you would have some suggestions or tips on how to set it up.

Should I set it up on the API side, when at least some endpoints are already done? But if my IdentityServer and the API are in different solutions, then for example running these tests locally, I would still have to start IdentityServer manually and then could run the tests on the API project which connect against it?

Or for me it would make more sense to have the tests, the test api and client in the IdentityServer project (much in the same way you have them in the source code solution). But when looking at the source code integration tests, I saw they had a separate Startup class for IdentityServer startup. Should I do this similarly or rather configure the tests to run against the Startup class of my own IdentityServer project? Then I would have to copy all the appSettings files etc.

I know it's quite a general question and topic, but any pointers will be appreciated on how to actually test the correct thing. I know I don't need to test a lot about the functionality itself as it's also done on your part, but I would rather have the integration tests for testing my own configuration etc, so if any of the components fail to communicate to each other, I would know immediately.

Thanks in advance!

vsamma avatar Nov 24 '17 10:11 vsamma

This seems to be a general question about IdentityServer - not a bug report or an issue.

Please use one of the our free or commercial support options

See here for more details.

Thanks!

leastprivilege avatar Nov 24 '17 12:11 leastprivilege

Yes, indeed it was. I even remember reading about the Support and Consulting options from the docs, sorry for forgetting.

Thanks for answering!

vsamma avatar Nov 24 '17 12:11 vsamma

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 14 '20 00:01 lock[bot]