Tech Tip: 4D NetKit: Redirect Callback
PRODUCT: 4D | VERSION: 21 | PLATFORM: Mac & Win
Published On: March 20, 2026
This tech tip about NetKit and redirect URI is a common use case, specially when connecting to third party services through OAuth.
This authentication method usually produces a callback which the host application will need to handle. The previous tech tip suggests to launch the 4D Web Server to attends this callback on the database method On Web Connection. While this way may provide more flexibility and control over the callbacks, 4D NetKit provides a built-in feature to handle callbacks.
According to the documentation, "the provider’s authorization response can be intercepted and handled either by the web server of the host or a web server included in 4D NetKit, depending on the port number specified in the redirectURI property."
In some conditions, 4D NetKit will launch its own web server to attend the callback. In this case, it is not needed to launch a separate web server just to handle the callback. Here are three conditions to ensure the 4D NetKit web server is launched:
Please read more in the documentation.
This authentication method usually produces a callback which the host application will need to handle. The previous tech tip suggests to launch the 4D Web Server to attends this callback on the database method On Web Connection. While this way may provide more flexibility and control over the callbacks, 4D NetKit provides a built-in feature to handle callbacks.
According to the documentation, "the provider’s authorization response can be intercepted and handled either by the web server of the host or a web server included in 4D NetKit, depending on the port number specified in the redirectURI property."
In some conditions, 4D NetKit will launch its own web server to attend the callback. In this case, it is not needed to launch a separate web server just to handle the callback. Here are three conditions to ensure the 4D NetKit web server is launched:
- If the redirectURI port is the same as the web server port of the host, 4D NetKit automatically uses the web server of the host to retrieve the authentication response.
- If redirectURI does not specify a port, the default port is used. If the host web server is also configured with the default port, it is used; otherwise, the 4D NetKit web server is started and used.
- In any other cases, the 4D NetKit web server is started and used.
Please read more in the documentation.