Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) Azure Fetch OpenID Connect metadata documentSee more OIDC ExamplesDownloads the OpenID Connect self-discovery document for an Azure OIDC enabled app. For more information, see https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc
LOCAL loHttp LOCAL lnSuccess LOCAL loResp LOCAL loJson LOCAL lcStrVal LOCAL lcToken_endpoint LOCAL lcJwks_uri LOCAL lcIssuer LOCAL lnRequest_uri_parameter_supported LOCAL lcUserinfo_endpoint LOCAL lcAuthorization_endpoint LOCAL lcDevice_authorization_endpoint LOCAL lnHttp_logout_supported LOCAL lnFrontchannel_logout_supported LOCAL lcEnd_session_endpoint LOCAL lcKerberos_endpoint LOCAL lcTenant_region_scope LOCAL lcCloud_instance_name LOCAL lcCloud_graph_host_name LOCAL lcMsgraph_host LOCAL lcRbac_url LOCAL i LOCAL lnCount_i * This example requires the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http') loHttp = CreateObject('Chilkat.Http') loHttp.Accept = "application/json" * See the Microsoft Azure OIDC documentation at https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc * The "tenant" can take one of four values described in the documentation at the link above. lnSuccess = loHttp.SetUrlVar("tenant","6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd") loResp = loHttp.QuickRequest("GET","https://login.microsoftonline.com/{$tenant}/v2.0/.well-known/openid-configuration") IF (loHttp.LastMethodSuccess <> 1) THEN ? loHttp.LastErrorText RELEASE loHttp CANCEL ENDIF ? "Response Status Code: " + STR(loResp.StatusCode) * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJson = CreateObject('Chilkat.JsonObject') loJson.Load(loResp.BodyStr) loJson.EmitCompact = 0 ? loJson.Emit() IF (loResp.StatusCode <> 200) THEN ? "Failed." RELEASE loResp RELEASE loHttp RELEASE loJson CANCEL ENDIF RELEASE loResp * Sample output... * (See the parsing code below..) * * Use the this online tool to generate parsing code from sample JSON: * Generate Parsing Code from JSON * { * "token_endpoint": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/oauth2/v2.0/token", * "token_endpoint_auth_methods_supported": [ * "client_secret_post", * "private_key_jwt", * "client_secret_basic" * ], * "jwks_uri": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/discovery/v2.0/keys", * "response_modes_supported": [ * "query", * "fragment", * "form_post" * ], * "subject_types_supported": [ * "pairwise" * ], * "id_token_signing_alg_values_supported": [ * "RS256" * ], * "response_types_supported": [ * "code", * "id_token", * "code id_token", * "id_token token" * ], * "scopes_supported": [ * "openid", * "profile", * "email", * "offline_access" * ], * "issuer": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/v2.0", * "request_uri_parameter_supported": false, * "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", * "authorization_endpoint": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/oauth2/v2.0/authorize", * "device_authorization_endpoint": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/oauth2/v2.0/devicecode", * "http_logout_supported": true, * "frontchannel_logout_supported": true, * "end_session_endpoint": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/oauth2/v2.0/logout", * "claims_supported": [ * "sub", * "iss", * "cloud_instance_name", * "cloud_instance_host_name", * "cloud_graph_host_name", * "msgraph_host", * "aud", * "exp", * "iat", * "auth_time", * "acr", * "nonce", * "preferred_username", * "name", * "tid", * "ver", * "at_hash", * "c_hash", * "email" * ], * "kerberos_endpoint": "https://login.microsoftonline.com/6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd/kerberos", * "tenant_region_scope": "NA", * "cloud_instance_name": "microsoftonline.com", * "cloud_graph_host_name": "graph.windows.net", * "msgraph_host": "graph.microsoft.com", * "rbac_url": "https://pas.windows.net" * } lcToken_endpoint = loJson.StringOf("token_endpoint") lcJwks_uri = loJson.StringOf("jwks_uri") lcIssuer = loJson.StringOf("issuer") lnRequest_uri_parameter_supported = loJson.BoolOf("request_uri_parameter_supported") lcUserinfo_endpoint = loJson.StringOf("userinfo_endpoint") lcAuthorization_endpoint = loJson.StringOf("authorization_endpoint") lcDevice_authorization_endpoint = loJson.StringOf("device_authorization_endpoint") lnHttp_logout_supported = loJson.BoolOf("http_logout_supported") lnFrontchannel_logout_supported = loJson.BoolOf("frontchannel_logout_supported") lcEnd_session_endpoint = loJson.StringOf("end_session_endpoint") lcKerberos_endpoint = loJson.StringOf("kerberos_endpoint") lcTenant_region_scope = loJson.StringOf("tenant_region_scope") lcCloud_instance_name = loJson.StringOf("cloud_instance_name") lcCloud_graph_host_name = loJson.StringOf("cloud_graph_host_name") lcMsgraph_host = loJson.StringOf("msgraph_host") lcRbac_url = loJson.StringOf("rbac_url") i = 0 lnCount_i = loJson.SizeOfArray("token_endpoint_auth_methods_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("token_endpoint_auth_methods_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("response_modes_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("response_modes_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("subject_types_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("subject_types_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("id_token_signing_alg_values_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("id_token_signing_alg_values_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("response_types_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("response_types_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("scopes_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("scopes_supported[i]") i = i + 1 ENDDO i = 0 lnCount_i = loJson.SizeOfArray("claims_supported") DO WHILE i < lnCount_i loJson.I = i lcStrVal = loJson.StringOf("claims_supported[i]") i = i + 1 ENDDO RELEASE loHttp RELEASE loJson |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.