Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Visual FoxPro Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(Visual FoxPro) OneLogin OIDC - Get Discovery Document (OpenID Connect)

Downloads the OpenID Connect self-discovery document for a OneLogin OIDC enabled app.

For more information, see https://developers.onelogin.com/openid-connect/connect-to-onelogin

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL loResp
LOCAL loJsonResponse
LOCAL lcAuthorization_endpoint
LOCAL lnClaims_parameter_supported
LOCAL lcIssuer
LOCAL lcJwks_uri
LOCAL lnRequest_parameter_supported
LOCAL lnRequest_uri_parameter_supported
LOCAL lcToken_endpoint
LOCAL lcUserinfo_endpoint
LOCAL lcIntrospection_endpoint
LOCAL lcRevocation_endpoint
LOCAL i
LOCAL lnCount_i
LOCAL lcStrVal

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

loHttp.Accept = "application/json"

loResp = loHttp.QuickRequest("GET","https://<account>.onelogin.com/oidc/.well-known/openid-configuration")
IF (loHttp.LastMethodSuccess <> 1) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

? "Response Status Code: " + STR(loResp.StatusCode)

loJsonResponse = CreateObject('Chilkat_9_5_0.JsonObject')
loJsonResponse.Load(loResp.BodyStr)
loJsonResponse.EmitCompact = 0
? loJsonResponse.Emit()

IF (loResp.StatusCode <> 200) THEN
    ? "Failed."
    RELEASE loResp
    RELEASE loHttp
    RELEASE loJsonResponse
    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

* {
*   "acr_values_supported": [
*     "onelogin:nist:level:1:re-auth"
*   ],
*   "authorization_endpoint": "https://chilkat-dev.onelogin.com/oidc/auth",
*   "claims_parameter_supported": true,
*   "claims_supported": [
*     "acr",
*     "auth_time",
*     "company",
*     "custom_fields",
*     "department",
*     "email",
*     "family_name",
*     "given_name",
*     "groups",
*     "iss",
*     "locale_code",
*     "name",
*     "params",
*     "phone_number",
*     "preferred_username",
*     "sid",
*     "sub",
*     "title",
*     "updated_at"
*   ],
*   "grant_types_supported": [
*     "authorization_code",
*     "implicit",
*     "refresh_token",
*     "client_credentials",
*     "password"
*   ],
*   "id_token_signing_alg_values_supported": [
*     "RS256"
*   ],
*   "issuer": "https://openid-connect.onelogin.com/oidc",
*   "jwks_uri": "https://chilkat-dev.onelogin.com/oidc/certs",
*   "request_parameter_supported": false,
*   "request_uri_parameter_supported": false,
*   "response_modes_supported": [
*     "form_post",
*     "fragment",
*     "query"
*   ],
*   "response_types_supported": [
*     "code",
*     "id_token token",
*     "id_token"
*   ],
*   "scopes_supported": [
*     "openid",
*     "name",
*     "profile",
*     "groups",
*     "email",
*     "params",
*     "phone"
*   ],
*   "subject_types_supported": [
*     "public"
*   ],
*   "token_endpoint": "https://chilkat-dev.onelogin.com/oidc/token",
*   "token_endpoint_auth_methods_supported": [
*     "client_secret_basic",
*     "client_secret_post",
*     "none"
*   ],
*   "userinfo_endpoint": "https://chilkat-dev.onelogin.com/oidc/me",
*   "userinfo_signing_alg_values_supported": [
*   ],
*   "code_challenge_methods_supported": [
*     "S256"
*   ],
*   "introspection_endpoint": "https://chilkat-dev.onelogin.com/oidc/token/introspection",
*   "introspection_endpoint_auth_methods_supported": [
*     "client_secret_basic",
*     "client_secret_post",
*     "none"
*   ],
*   "revocation_endpoint": "https://chilkat-dev.onelogin.com/oidc/token/revocation",
*   "revocation_endpoint_auth_methods_supported": [
*     "client_secret_basic",
*     "client_secret_post",
*     "none"
*   ],
*   "claim_types_supported": [
*     "normal"
*   ]
* }
* 

lcAuthorization_endpoint = loJsonResponse.StringOf("authorization_endpoint")
lnClaims_parameter_supported = loJsonResponse.BoolOf("claims_parameter_supported")
lcIssuer = loJsonResponse.StringOf("issuer")
lcJwks_uri = loJsonResponse.StringOf("jwks_uri")
lnRequest_parameter_supported = loJsonResponse.BoolOf("request_parameter_supported")
lnRequest_uri_parameter_supported = loJsonResponse.BoolOf("request_uri_parameter_supported")
lcToken_endpoint = loJsonResponse.StringOf("token_endpoint")
lcUserinfo_endpoint = loJsonResponse.StringOf("userinfo_endpoint")
lcIntrospection_endpoint = loJsonResponse.StringOf("introspection_endpoint")
lcRevocation_endpoint = loJsonResponse.StringOf("revocation_endpoint")
i = 0
lnCount_i = loJsonResponse.SizeOfArray("acr_values_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("acr_values_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("claims_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("claims_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("grant_types_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("grant_types_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("id_token_signing_alg_values_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("id_token_signing_alg_values_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("response_modes_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("response_modes_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("response_types_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("response_types_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("scopes_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("scopes_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("subject_types_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("subject_types_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("token_endpoint_auth_methods_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("token_endpoint_auth_methods_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("userinfo_signing_alg_values_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("code_challenge_methods_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("code_challenge_methods_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("introspection_endpoint_auth_methods_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("introspection_endpoint_auth_methods_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("revocation_endpoint_auth_methods_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("revocation_endpoint_auth_methods_supported[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJsonResponse.SizeOfArray("claim_types_supported")
DO WHILE i < lnCount_i
    loJsonResponse.I = i
    lcStrVal = loJsonResponse.StringOf("claim_types_supported[i]")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loJsonResponse


 

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