4D Blog

Home Product 4D NetKit: Simplifying OAuth 2.0 Redirects after authentication

4D NetKit: Simplifying OAuth 2.0 Redirects after authentication

October 15, 2025

Product

4D NetKit just made redirecting users after OAuth 2.0 authentication easier with 4D 21. The OAuth2Provider class in 4D NetKit now allows real URLs for authenticationPage and authenticationErrorPage. This means you now have more redirection options after authentication, like a Qodly pages or HTTP Handlers. Whether the authentication succeeds or fails, you stay in control of the user experience with smooth, flexible redirection options.

What changed?

These two attributes were already part of the NetKit.OAuth2Provider class, but they previously required a relative URL. Now, you can pass a full URL to either field, pointing directly to a custom Qodly page or any web destination of your choice.

var $credential:={}

$credential.name:="Microsoft"
$credential.permission:="signedIn"
$credential.clientId:="xxxxx"
$credential.redirectURI:="http://127.0.0.1:50993/authorize/"
$credential.scope:="https://graph.microsoft.com/.default"
$credential.browserAutoOpen:=False

// If authentication succeeds, redirect the user to the Calendar page
$credential.authenticationPage:="http://localhost/$lib/renderer/?w=Calendar"

// If authentication fails, redirect the user to the Connect (login) page
$credential.authenticationErrorPage:="http://localhost/$lib/renderer/?w=Connect"

// Create new OAuth2 object
return cs.NetKit.OAuth2Provider.new($credential)

Redirecting to custom URLs simplifies the overall authentication flow. Instead of building extra logic to navigate users after a successful login or failed attempt, you can now:

  • Send users directly to the next page in your app
  • Handle authentication errors gracefully with a dedicated error page

Conclusion

By letting the OAuth2 process take care of redirection, you reduce complexity in your code and avoid unnecessary intermediate steps. Just configure your URLs, and 4D will handle the rest.

Discuss

Tags 21, 4D NetKit, OAuth 2.0

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy