navikt / mock-oauth2-server

A scriptable/customizable web server for testing HTTP clients using OAuth2/OpenID Connect or applications with a dependency to a running OAuth2 server (i.e. APIs requiring signed JWTs from a known issuer)
MIT License
223 stars 54 forks source link

Deny user access - negative testing #690

Open gpsmit opened 1 month ago

gpsmit commented 1 month ago

Hi Team,

We are working on integration tests and are satisfied with all the mocking capabilities for the happy flow: User logs in -> check user info, check valid access token etc.

But, we would also like to run a scenario where a user tries to log in, but the identity provider/mock server rejects the username/password and thus access denied checks can be performed in the app. Is there a way for the mock server to test such a scenario?