Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

PowerBuilder Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(PowerBuilder) Azure Fetch OpenID Connect metadata document

See more OIDC Examples

Downloads 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

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Resp
oleobject loo_Json
string ls_StrVal
string ls_Token_endpoint
string ls_Jwks_uri
string ls_Issuer
integer li_Request_uri_parameter_supported
string ls_Userinfo_endpoint
string ls_Authorization_endpoint
string ls_Device_authorization_endpoint
integer li_Http_logout_supported
integer li_Frontchannel_logout_supported
string ls_End_session_endpoint
string ls_Kerberos_endpoint
string ls_Tenant_region_scope
string ls_Cloud_instance_name
string ls_Cloud_graph_host_name
string ls_Msgraph_host
string ls_Rbac_url
integer i
integer li_Count_i

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Http.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.

li_Success = loo_Http.SetUrlVar("tenant","6d8ddd66-68d1-44b0-af5c-e31b4b7ee5cd")
loo_Resp = loo_Http.QuickRequest("GET","https://login.microsoftonline.com/{$tenant}/v2.0/.well-known/openid-configuration")
if loo_Http.LastMethodSuccess <> 1 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    return
end if

Write-Debug "Response Status Code: " + string(loo_Resp.StatusCode)

loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

loo_Json.Load(loo_Resp.BodyStr)
loo_Json.EmitCompact = 0
Write-Debug loo_Json.Emit()

if loo_Resp.StatusCode <> 200 then
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Json
    return
end if

destroy loo_Resp

// 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"
// }

ls_Token_endpoint = loo_Json.StringOf("token_endpoint")
ls_Jwks_uri = loo_Json.StringOf("jwks_uri")
ls_Issuer = loo_Json.StringOf("issuer")
li_Request_uri_parameter_supported = loo_Json.BoolOf("request_uri_parameter_supported")
ls_Userinfo_endpoint = loo_Json.StringOf("userinfo_endpoint")
ls_Authorization_endpoint = loo_Json.StringOf("authorization_endpoint")
ls_Device_authorization_endpoint = loo_Json.StringOf("device_authorization_endpoint")
li_Http_logout_supported = loo_Json.BoolOf("http_logout_supported")
li_Frontchannel_logout_supported = loo_Json.BoolOf("frontchannel_logout_supported")
ls_End_session_endpoint = loo_Json.StringOf("end_session_endpoint")
ls_Kerberos_endpoint = loo_Json.StringOf("kerberos_endpoint")
ls_Tenant_region_scope = loo_Json.StringOf("tenant_region_scope")
ls_Cloud_instance_name = loo_Json.StringOf("cloud_instance_name")
ls_Cloud_graph_host_name = loo_Json.StringOf("cloud_graph_host_name")
ls_Msgraph_host = loo_Json.StringOf("msgraph_host")
ls_Rbac_url = loo_Json.StringOf("rbac_url")
i = 0
li_Count_i = loo_Json.SizeOfArray("token_endpoint_auth_methods_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("token_endpoint_auth_methods_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("response_modes_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("response_modes_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("subject_types_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("subject_types_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("id_token_signing_alg_values_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("id_token_signing_alg_values_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("response_types_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("response_types_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("scopes_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("scopes_supported[i]")
    i = i + 1
loop
i = 0
li_Count_i = loo_Json.SizeOfArray("claims_supported")
do while i < li_Count_i
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("claims_supported[i]")
    i = i + 1
loop


destroy loo_Http
destroy loo_Json

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.