4D Blog

Home Product 4D Netkit: OAuth2.0 authentication using a certificate

4D Netkit: OAuth2.0 authentication using a certificate

May 8, 2024

Product

Several OAuth 2.0 servers, like the Microsoft Identity Platform, provide an authentication option utilizing certificates instead of client secrets. This approach enhances security and authentication mechanisms within the protocol. Starting from version 4D 20 R5, Netkit incorporates OAuth 2.0 certificate-based connection management.

Using the Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants offers enhanced security over client secrets. It allows for encrypted and digitally signed assertions, bolstering authentication mechanisms with additional identification information like digital certificates or JWTs. This reduces risks associated with secret management, providing a more secure method for authentication and authorization.

To use certificates, you need to be in “Service” permission and use the .privateKey  and .thumbprint properties of your OAuth2Provider object.

If you want to use certificates with Microsoft Identity Platform:

  • Go to the Azure App registration interface and upload your certificate to obtain your Thumbprint code:

  • You now have a valid Thumbprint to obtain your token:
var $params;$token : Object
var $oAuth : cs.NetKit.OAuth2Provider
var $privatekey:=File("/RESOURCES/key.pem").getText("ascii"; Document unchanged)

If (Length($t_privatekey)>0)
	$params:=New object()
	$params.name:="Microsoft"
	// Only usable with permission:="Service"
	$params.permission:="Service"
	$params.clientId:="8008ebf5-xxx"
	
	$params.scope:="https://graph.microsoft.com/.default"
	$params.tenant:="16dc191b-xxx"
	$params.clientEmail:=$myClientEmail
	
	// Certificate private key
        $params.privateKey:=$t_privatekey
        // Thumbprint of certificate / public key can be copied in Azure portal at certificated & secrets
	$params.thumbprint:="A4CC91B864xxx"  
	
	$oAuth:=cs.NetKit.OAuth2Provider.new($params)
	$token:=$cs_oAuth.getToken()
End if 

In conclusion, using an OAuth 2.0 certificate-based authentication, as outlined in RFC 7521, enhances security measures over client secrets. By following the documentation guidelines, developers can securely integrate certificates with OAuth 2.0 servers like the Microsoft Identity Platform, ensuring robust application authentication mechanisms.

Discuss

Tags 20 R5, 21, 4D NetKit

Latest related posts

  • November 14, 2025

    Event Report in 4D Qodly Pro: See Every Interactions at a Glance

  • November 14, 2025

    4D Qodly Pro: Page Zoom Controls

  • November 13, 2025

    macOS Tahoe, Windows 11, which operating systems for 4D 20 and 21?

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-Analyzer 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 Formula Listbox Logs Mail Microsoft 365 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-Analyzer 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 Formula Listbox Logs Mail Microsoft 365 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