Skip to content

How to do integration tests when using Quarkus OIDC code flow authentication? #43910

Answered by sberyozkin
douglas444 asked this question in Q&A
Discussion options

You must be logged in to vote

@douglas444, to test OIDC code flow, we offer https://quarkus.io/guides/security-oidc-code-flow-authentication#code-flow-integration-testing-wiremock.

Several default stubs are available there, for the auto-discovery, key acquisition, code flow redirect which is a tricky part. Additionally you can add more stubs directly in the test code, inject first, and then set required stubs like this one, etc.

It feels hacky to depend on elements of the HTML page as it is Keycloak's not mine, but I guess there is no other way.

It indeed does not matter, the default Wiremock stub presents it as if if it were a challenge from Keycloak, but it is not what is tested, this page only supports the test f…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sberyozkin
Comment options

Answer selected by douglas444
@douglas444
Comment options

@sberyozkin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants