There are different options, depends on your env,
1. gateway provides login window, and pass the credential to webapp
webapp needs to provide API to accept credential and return the result.
2. gateway redirect to webapp page, webapp shows login window and redirect back to gateway after authentication
usually, the gateway needs to be registered on webapp, otherwise the webapp will not know how to redirect back to gateway.
for example, using ADFS for login, you need to register gateway as a relying party and set the call back url.
I have an document on this, Integrate ADFS login form for authentication
3. customize OTK to use external login server.
https://communities.ca.com/blogs/oauth/2016/10/04/howto-integrating-otk-with-external-login-server
option 1 is the simplest, option 2 needs correct implementation/configuration on both gateway and authentication server, option 3 is possible but not recommended, you need deep knowledge on oauth flow, and how the otk implement.