Some of our endpoints that change data need user context. Our API uses OpenIdConnect for authentication. The automated API test suit uses the client credentials flow and hence does not have a user context. So i was wondering how are such problems solved elsewhere? how do you make such endpoints testable? Our UI uses the authorisation code flow.
What i tried already is thinking about the resource owner credentials grant and setup a service user for tests but our OAuth server has 2FA enabled and there is no way to pass on the TOTP code.