Microsoft Azure is a cloud computing service operated by Microsoft for application management via Microsoft-managed data centers. It provides software as a service (SaaS), platform as a service (PaaS) and infrastructure as a service (IaaS) and supports many different programming languages, tools, and frameworks, including both Microsoft-specific and third-party software and systems.
Our sgcOpenAPI Client Parser can read the OpenAPI / Swagger Amazon AWS specifications and create automatically client interfaces in 100% pascal code, so it can be integrated in any Delphi, CBuilder or Lazarus Application.
You can check here the full list of more than 650 Microsoft and Azure Services:
The list includes popular services like:
The sgcOpenAPI Microsoft Client (TsgcOpenAPI_Microsoft_Client) has it's own OpenAPI Client which inherits from TsgcOpenAPI_Client.
This component has a property called MicrosoftOptions that includes all required configurations to connect to Microsoft Servers.
The OpenAPI Microsoft client allows to authenticate using the following methods:
The authentication is configured in the property MicrosoftOptions.Authentication, allows the following values:
Other properties required by Microsoft are the following:
Using OAuth2 Code Grant Flow doesn't requires interaction with the user, so is suitable for services, daemons... or any application that must run without user interaction.
To configure the OpenAPI Client for OAuth2 Code Grant, configure the property MicrosoftOptions.Authentication with the following value:
GetOpenAPIClient.MicrosoftOptions.Authentication := oamaOAuth2Credentials; GetOpenAPIClient.Authentication.OAuth2.AuthorizationServerOptions.AuthURL := 'https://login.microsoftonline.com/tenant_id/oauth2/v2.0/authorize'; GetOpenAPIClient.Authentication.OAuth2.AuthorizationServerOptions.TokenURL := 'https://login.microsoftonline.com/tenant_id/oauth2/v2.0/token'; GetOpenAPIClient.Authentication.OAuth2.OAuth2Options.ClientId := '90945b8d-f6b7-4b97-b2bd-21c3c90b5f3b'; GetOpenAPIClient.Authentication.OAuth2.OAuth2Options.ClientSecret := 'client_secret'; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.IP := '127.0.0.1'; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.Port := 8080; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.SSL := True; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.SSLOptions.Port := 8080; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.SSLOptions.CertFile := 'sgc.pem'; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.SSLOptions.KeyFile := 'sgc.pem'; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.SSLOptions.Password := ''; GetOpenAPIClient.Authentication.OAuth2.LocalServerOptions.RedirectURL := 'https://localhost:8080'; GetOpenAPIClient.Authentication.OAuth2.AuthorizationServerOptions.Scope.Text := 'openapi';
The Tenant ID must be configured for the Authentication and Token URLs, just replace the correct Tenant Id in the url.
Microsoft only allows the URL localhost if you are listening in the Local IP, so set the redirect URL with localhost as dns name instead of configure with the IP address.
The scope value depends of the API, check the Microsoft / Azure documentation for every API.
OAuth2 credentials doesn't require any user interaction, so no browser will be opened the first HTTP request call.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.