Tech Tip: 4D Netkit OAuth redirect URI: 404 Not found.
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: July 31, 2025
4D Netkit is a built-in 4D component that allows 4D to communicate with third-party web services and APIs.
The OAuth2Provider class in Netkit allows the authentication with the mentioned services by obtaining tokens.
Independently of the service 4D developers try to use, there is a redirectURI to which the service calls back to send the authentication token.
Here is a common example:
$credential.redirectURI:="https://127.0.0.1/authorize" |
During development of the application, the redirect URI points to the 4D Web Server, usually in localhost, or 127.0.0.1.
However, without proper management, this callback may cause a 404 error in the browser.
To solve this error, please make sure to manage this route on the On Web Connection database method, in this case the /authorize.
The third-party service also returns the authorization token in this URI. In the same database method, the token should be obtained to be attached to future calls to the service or API.
You can read more about Netkit and find sample projects in the 4D Blog.