Chilkat Online Tools

SQL Server / ForgeRock Identity Cloud Collection / Step 4: Create a Confidential OAuth 2.0 Client

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    -- Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    -- The following JSON is sent in the request body.

    -- {
    --   "coreOAuth2ClientConfig": {
    --     "agentgroup": "",
    --     "status": {
    --       "inherited": false,
    --       "value": "Active"
    --     },
    --     "userpassword": "{{postmanClientSecret}}",
    --     "clientType": {
    --       "inherited": false,
    --       "value": "Confidential"
    --     },
    --     "loopbackInterfaceRedirection": {
    --       "inherited": true,
    --       "value": true
    --     },
    --     "redirectionUris": {
    --       "inherited": false,
    --       "value": [
    --         "https://httpbin.org/anything"
    --       ]
    --     },
    --     "scopes": {
    --       "inherited": false,
    --       "value": [
    --         "write",
    --         "read",
    --         "share",
    --         "print",
    --         "copy",
    --         "delete",
    --         "manage",
    --         "edit"
    --       ]
    --     },
    --     "defaultScopes": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "clientName": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "authorizationCodeLifetime": {
    --       "inherited": true,
    --       "value": 0
    --     },
    --     "refreshTokenLifetime": {
    --       "inherited": true,
    --       "value": 0
    --     },
    --     "accessTokenLifetime": {
    --       "inherited": true,
    --       "value": 0
    --     }
    --   },
    --   "advancedOAuth2ClientConfig": {
    --     "name": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "descriptions": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "requestUris": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "responseTypes": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "grantTypes": {
    --       "inherited": false,
    --       "value": [
    --         "authorization_code",
    --         "implicit",
    --         "password",
    --         "client_credentials",
    --         "refresh_token",
    --         "urn:ietf:params:oauth:grant-type:uma-ticket",
    --         "urn:ietf:params:oauth:grant-type:device_code",
    --         "urn:ietf:params:oauth:grant-type:saml2-bearer",
    --         "urn:ietf:params:oauth:grant-type:jwt-bearer",
    --         "urn:openid:params:grant-type:ciba"
    --       ]
    --     },
    --     "contacts": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "tokenEndpointAuthMethod": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "sectorIdentifierUri": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "subjectType": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "updateAccessToken": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "clientUri": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "logoUri": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "policyUri": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "isConsentImplied": {
    --       "inherited": true,
    --       "value": true
    --     },
    --     "mixUpMitigation": {
    --       "inherited": true,
    --       "value": true
    --     }
    --   },
    --   "coreOpenIDClientConfig": {
    --     "claims": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "postLogoutRedirectUri": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "clientSessionUri": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "defaultMaxAge": {
    --       "inherited": true,
    --       "value": 0
    --     },
    --     "defaultMaxAgeEnabled": {
    --       "inherited": true,
    --       "value": true
    --     },
    --     "defaultAcrValues": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     },
    --     "jwtTokenLifetime": {
    --       "inherited": true,
    --       "value": 0
    --     }
    --   },
    --   "signEncOAuth2ClientConfig": {
    --     "jwksUri": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "jwksCacheTimeout": {
    --       "inherited": true,
    --       "value": 0
    --     },
    --     "jwkStoreCacheMissCacheTime": {
    --       "inherited": true,
    --       "value": 0
    --     },
    --     "tokenEndpointAuthSigningAlgorithm": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "jwkSet": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "idTokenSignedResponseAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "idTokenEncryptionEnabled": {
    --       "inherited": true,
    --       "value": true
    --     },
    --     "idTokenEncryptionAlgorithm": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "idTokenEncryptionMethod": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "idTokenPublicEncryptionKey": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "clientJwtPublicKey": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "mTLSTrustedCert": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "mTLSSubjectDN": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "mTLSCertificateBoundAccessTokens": {
    --       "inherited": true,
    --       "value": true
    --     },
    --     "publicKeyLocation": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "userinfoResponseFormat": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "userinfoSignedResponseAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "userinfoEncryptedResponseAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "userinfoEncryptedResponseEncryptionAlgorithm": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "requestParameterSignedAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "requestParameterEncryptedAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "requestParameterEncryptedEncryptionAlgorithm": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "tokenIntrospectionResponseFormat": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "tokenIntrospectionSignedResponseAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "tokenIntrospectionEncryptedResponseAlg": {
    --       "inherited": true,
    --       "value": "string"
    --     },
    --     "tokenIntrospectionEncryptedResponseEncryptionAlgorithm": {
    --       "inherited": true,
    --       "value": "string"
    --     }
    --   },
    --   "coreUmaClientConfig": {
    --     "claimsRedirectionUris": {
    --       "inherited": true,
    --       "value": [
    --         "Unknown Type: any"
    --       ]
    --     }
    --   }
    -- }

    DECLARE @json int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT

    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.agentgroup', ''
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.status.inherited', 0
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.status.value', 'Active'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.userpassword', '{{postmanClientSecret}}'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.clientType.inherited', 0
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.clientType.value', 'Confidential'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.loopbackInterfaceRedirection.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.loopbackInterfaceRedirection.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.redirectionUris.inherited', 0
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.redirectionUris.value[0]', 'https://httpbin.org/anything'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.scopes.inherited', 0
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[0]', 'write'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[1]', 'read'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[2]', 'share'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[3]', 'print'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[4]', 'copy'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[5]', 'delete'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[6]', 'manage'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.scopes.value[7]', 'edit'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.defaultScopes.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.defaultScopes.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.clientName.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOAuth2ClientConfig.clientName.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.authorizationCodeLifetime.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'coreOAuth2ClientConfig.authorizationCodeLifetime.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.refreshTokenLifetime.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'coreOAuth2ClientConfig.refreshTokenLifetime.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOAuth2ClientConfig.accessTokenLifetime.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'coreOAuth2ClientConfig.accessTokenLifetime.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.name.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.name.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.descriptions.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.descriptions.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.requestUris.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.requestUris.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.responseTypes.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.responseTypes.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.inherited', 0
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[0]', 'authorization_code'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[1]', 'implicit'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[2]', 'password'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[3]', 'client_credentials'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[4]', 'refresh_token'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[5]', 'urn:ietf:params:oauth:grant-type:uma-ticket'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[6]', 'urn:ietf:params:oauth:grant-type:device_code'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[7]', 'urn:ietf:params:oauth:grant-type:saml2-bearer'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[8]', 'urn:ietf:params:oauth:grant-type:jwt-bearer'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.grantTypes.value[9]', 'urn:openid:params:grant-type:ciba'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.contacts.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.contacts.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.tokenEndpointAuthMethod.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.tokenEndpointAuthMethod.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.sectorIdentifierUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.sectorIdentifierUri.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.subjectType.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.subjectType.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.updateAccessToken.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.updateAccessToken.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.clientUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.clientUri.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.logoUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.logoUri.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.policyUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'advancedOAuth2ClientConfig.policyUri.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.isConsentImplied.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.isConsentImplied.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.mixUpMitigation.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'advancedOAuth2ClientConfig.mixUpMitigation.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.claims.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOpenIDClientConfig.claims.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.postLogoutRedirectUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOpenIDClientConfig.postLogoutRedirectUri.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.clientSessionUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOpenIDClientConfig.clientSessionUri.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.defaultMaxAge.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'coreOpenIDClientConfig.defaultMaxAge.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.defaultMaxAgeEnabled.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.defaultMaxAgeEnabled.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.defaultAcrValues.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreOpenIDClientConfig.defaultAcrValues.value[0]', 'Unknown Type: any'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreOpenIDClientConfig.jwtTokenLifetime.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'coreOpenIDClientConfig.jwtTokenLifetime.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.jwksUri.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.jwksUri.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.jwksCacheTimeout.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'signEncOAuth2ClientConfig.jwksCacheTimeout.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.jwkStoreCacheMissCacheTime.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'signEncOAuth2ClientConfig.jwkStoreCacheMissCacheTime.value', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.tokenEndpointAuthSigningAlgorithm.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.tokenEndpointAuthSigningAlgorithm.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.jwkSet.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.jwkSet.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenSignedResponseAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.idTokenSignedResponseAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionEnabled.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionEnabled.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionAlgorithm.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionAlgorithm.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionMethod.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.idTokenEncryptionMethod.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.idTokenPublicEncryptionKey.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.idTokenPublicEncryptionKey.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.clientJwtPublicKey.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.clientJwtPublicKey.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.mTLSTrustedCert.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.mTLSTrustedCert.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.mTLSSubjectDN.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.mTLSSubjectDN.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.mTLSCertificateBoundAccessTokens.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.mTLSCertificateBoundAccessTokens.value', 1
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.publicKeyLocation.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.publicKeyLocation.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.userinfoResponseFormat.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.userinfoResponseFormat.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.userinfoSignedResponseAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.userinfoSignedResponseAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.userinfoEncryptedResponseAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.userinfoEncryptedResponseAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.userinfoEncryptedResponseEncryptionAlgorithm.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.userinfoEncryptedResponseEncryptionAlgorithm.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.requestParameterSignedAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.requestParameterSignedAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.requestParameterEncryptedAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.requestParameterEncryptedAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.requestParameterEncryptedEncryptionAlgorithm.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.requestParameterEncryptedEncryptionAlgorithm.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionResponseFormat.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionResponseFormat.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionSignedResponseAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionSignedResponseAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionEncryptedResponseAlg.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionEncryptedResponseAlg.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionEncryptedResponseEncryptionAlgorithm.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'signEncOAuth2ClientConfig.tokenIntrospectionEncryptedResponseEncryptionAlgorithm.value', 'string'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'coreUmaClientConfig.claimsRedirectionUris.inherited', 1
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'coreUmaClientConfig.claimsRedirectionUris.value[0]', 'Unknown Type: any'

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'accept', 'application/json'
    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'X-Requested-With', 'ForgeRock Identity Cloud Postman Collection'
    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json'
    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, '{{cookieName}}', '{{adminSSOToken}}'

    DECLARE @sbRequestBody int
    -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbRequestBody OUT

    EXEC sp_OAMethod @json, 'EmitSb', @success OUT, @sbRequestBody

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'PTextSb', @resp OUT, 'PUT', 'https://<tenant-name>.forgeblocks.com/am/json/realms/root/realms/alpha/realm-config/agents/OAuth2Client/postmanConfidentialClient', @sbRequestBody, 'utf-8', 'application/json', 0, 0
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @json
        EXEC @hr = sp_OADestroy @sbRequestBody
        RETURN
      END

    EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
    PRINT @iTmp0
    EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
    PRINT @sTmp0
    EXEC @hr = sp_OADestroy @resp


    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @json
    EXEC @hr = sp_OADestroy @sbRequestBody


END
GO

Curl Command

curl -X PUT
	-H "accept: application/json"
	-H "Content-Type: application/json"
	-H "X-Requested-With: ForgeRock Identity Cloud Postman Collection"
	-H "{{cookieName}}: {{adminSSOToken}}"
	-d '{
  "coreOAuth2ClientConfig": {
    "agentgroup": "",
    "status": {
      "inherited": false,
      "value": "Active"
    },
    
    "userpassword": "{{postmanClientSecret}}",
    "clientType": {
      "inherited": false,
      "value": "Confidential"
    },
    "loopbackInterfaceRedirection": {
      "inherited": true,
      "value": true
    },
    "redirectionUris": {
      "inherited": false,
      "value": [
        "https://httpbin.org/anything"
      ]
    },
    "scopes": {
      "inherited": false,
      "value": [
        "write",
        "read",
        "share",
        "print",
        "copy",
        "delete",
        "manage",
        "edit"
      ]
    },
    "defaultScopes": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "clientName": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "authorizationCodeLifetime": {
      "inherited": true,
      "value": 0
    },
    "refreshTokenLifetime": {
      "inherited": true,
      "value": 0
    },
    "accessTokenLifetime": {
      "inherited": true,
      "value": 0
    }
  },
  "advancedOAuth2ClientConfig": {
    "name": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "descriptions": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "requestUris": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "responseTypes": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "grantTypes": {
      "inherited": false,
      "value": [
        "authorization_code",
        "implicit",
        "password",
        "client_credentials",
        "refresh_token",
        "urn:ietf:params:oauth:grant-type:uma-ticket",
        "urn:ietf:params:oauth:grant-type:device_code",
        "urn:ietf:params:oauth:grant-type:saml2-bearer",
        "urn:ietf:params:oauth:grant-type:jwt-bearer",
        "urn:openid:params:grant-type:ciba"
      ]
    },
    "contacts": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "tokenEndpointAuthMethod": {
      "inherited": true,
      "value": "string"
    },
    "sectorIdentifierUri": {
      "inherited": true,
      "value": "string"
    },
    "subjectType": {
      "inherited": true,
      "value": "string"
    },
    "updateAccessToken": {
      "inherited": true,
      "value": "string"
    },
    "clientUri": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "logoUri": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "policyUri": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "isConsentImplied": {
      "inherited": true,
      "value": true
    },
    "mixUpMitigation": {
      "inherited": true,
      "value": true
    }
  },
  "coreOpenIDClientConfig": {
    "claims": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "postLogoutRedirectUri": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "clientSessionUri": {
      "inherited": true,
      "value": "string"
    },
    "defaultMaxAge": {
      "inherited": true,
      "value": 0
    },
    "defaultMaxAgeEnabled": {
      "inherited": true,
      "value": true
    },
    "defaultAcrValues": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    },
    "jwtTokenLifetime": {
      "inherited": true,
      "value": 0
    }
  },
  "signEncOAuth2ClientConfig": {
    "jwksUri": {
      "inherited": true,
      "value": "string"
    },
    "jwksCacheTimeout": {
      "inherited": true,
      "value": 0
    },
    "jwkStoreCacheMissCacheTime": {
      "inherited": true,
      "value": 0
    },
    "tokenEndpointAuthSigningAlgorithm": {
      "inherited": true,
      "value": "string"
    },
    "jwkSet": {
      "inherited": true,
      "value": "string"
    },
    "idTokenSignedResponseAlg": {
      "inherited": true,
      "value": "string"
    },
    "idTokenEncryptionEnabled": {
      "inherited": true,
      "value": true
    },
    "idTokenEncryptionAlgorithm": {
      "inherited": true,
      "value": "string"
    },
    "idTokenEncryptionMethod": {
      "inherited": true,
      "value": "string"
    },
    "idTokenPublicEncryptionKey": {
      "inherited": true,
      "value": "string"
    },
    "clientJwtPublicKey": {
      "inherited": true,
      "value": "string"
    },
    "mTLSTrustedCert": {
      "inherited": true,
      "value": "string"
    },
    "mTLSSubjectDN": {
      "inherited": true,
      "value": "string"
    },
    "mTLSCertificateBoundAccessTokens": {
      "inherited": true,
      "value": true
    },
    "publicKeyLocation": {
      "inherited": true,
      "value": "string"
    },
    "userinfoResponseFormat": {
      "inherited": true,
      "value": "string"
    },
    "userinfoSignedResponseAlg": {
      "inherited": true,
      "value": "string"
    },
    "userinfoEncryptedResponseAlg": {
      "inherited": true,
      "value": "string"
    },
    "userinfoEncryptedResponseEncryptionAlgorithm": {
      "inherited": true,
      "value": "string"
    },
    "requestParameterSignedAlg": {
      "inherited": true,
      "value": "string"
    },
    "requestParameterEncryptedAlg": {
      "inherited": true,
      "value": "string"
    },
    "requestParameterEncryptedEncryptionAlgorithm": {
      "inherited": true,
      "value": "string"
    },
    "tokenIntrospectionResponseFormat": {
      "inherited": true,
      "value": "string"
    },
    "tokenIntrospectionSignedResponseAlg": {
      "inherited": true,
      "value": "string"
    },
    "tokenIntrospectionEncryptedResponseAlg": {
      "inherited": true,
      "value": "string"
    },
    "tokenIntrospectionEncryptedResponseEncryptionAlgorithm": {
      "inherited": true,
      "value": "string"
    }
  },
  "coreUmaClientConfig": {
    "claimsRedirectionUris": {
      "inherited": true,
      "value": [
        "Unknown Type: any"
      ]
    }
  }
}'
https://<tenant-name>.forgeblocks.com/am/json/realms/root/realms/alpha/realm-config/agents/OAuth2Client/postmanConfidentialClient

Postman Collection Item JSON

{
  "name": "Step 4: Create a Confidential OAuth 2.0 Client",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "accept",
        "value": "application/json",
        "type": "text",
        "description": "Specifies certain media types which are acceptable for the resource."
      },
      {
        "key": "Content-Type",
        "value": "application/json",
        "type": "text",
        "description": "The media type of the resource."
      },
      {
        "key": "X-Requested-With",
        "value": "ForgeRock Identity Cloud Postman Collection",
        "type": "text",
        "description": "Custom header."
      },
      {
        "key": "{{cookieName}}",
        "value": "{{adminSSOToken}}",
        "type": "text",
        "description": "SSO token of an administrator. "
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"coreOAuth2ClientConfig\": {\n    \"agentgroup\": \"\",\n    \"status\": {\n      \"inherited\": false,\n      \"value\": \"Active\"\n    },\n    \n    \"userpassword\": \"{{postmanClientSecret}}\",\n    \"clientType\": {\n      \"inherited\": false,\n      \"value\": \"Confidential\"\n    },\n    \"loopbackInterfaceRedirection\": {\n      \"inherited\": true,\n      \"value\": true\n    },\n    \"redirectionUris\": {\n      \"inherited\": false,\n      \"value\": [\n        \"https://httpbin.org/anything\"\n      ]\n    },\n    \"scopes\": {\n      \"inherited\": false,\n      \"value\": [\n        \"write\",\n        \"read\",\n        \"share\",\n        \"print\",\n        \"copy\",\n        \"delete\",\n        \"manage\",\n        \"edit\"\n      ]\n    },\n    \"defaultScopes\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"clientName\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"authorizationCodeLifetime\": {\n      \"inherited\": true,\n      \"value\": 0\n    },\n    \"refreshTokenLifetime\": {\n      \"inherited\": true,\n      \"value\": 0\n    },\n    \"accessTokenLifetime\": {\n      \"inherited\": true,\n      \"value\": 0\n    }\n  },\n  \"advancedOAuth2ClientConfig\": {\n    \"name\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"descriptions\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"requestUris\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"responseTypes\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"grantTypes\": {\n      \"inherited\": false,\n      \"value\": [\n        \"authorization_code\",\n        \"implicit\",\n        \"password\",\n        \"client_credentials\",\n        \"refresh_token\",\n        \"urn:ietf:params:oauth:grant-type:uma-ticket\",\n        \"urn:ietf:params:oauth:grant-type:device_code\",\n        \"urn:ietf:params:oauth:grant-type:saml2-bearer\",\n        \"urn:ietf:params:oauth:grant-type:jwt-bearer\",\n        \"urn:openid:params:grant-type:ciba\"\n      ]\n    },\n    \"contacts\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"tokenEndpointAuthMethod\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"sectorIdentifierUri\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"subjectType\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"updateAccessToken\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"clientUri\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"logoUri\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"policyUri\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"isConsentImplied\": {\n      \"inherited\": true,\n      \"value\": true\n    },\n    \"mixUpMitigation\": {\n      \"inherited\": true,\n      \"value\": true\n    }\n  },\n  \"coreOpenIDClientConfig\": {\n    \"claims\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"postLogoutRedirectUri\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"clientSessionUri\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"defaultMaxAge\": {\n      \"inherited\": true,\n      \"value\": 0\n    },\n    \"defaultMaxAgeEnabled\": {\n      \"inherited\": true,\n      \"value\": true\n    },\n    \"defaultAcrValues\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    },\n    \"jwtTokenLifetime\": {\n      \"inherited\": true,\n      \"value\": 0\n    }\n  },\n  \"signEncOAuth2ClientConfig\": {\n    \"jwksUri\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"jwksCacheTimeout\": {\n      \"inherited\": true,\n      \"value\": 0\n    },\n    \"jwkStoreCacheMissCacheTime\": {\n      \"inherited\": true,\n      \"value\": 0\n    },\n    \"tokenEndpointAuthSigningAlgorithm\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"jwkSet\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"idTokenSignedResponseAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"idTokenEncryptionEnabled\": {\n      \"inherited\": true,\n      \"value\": true\n    },\n    \"idTokenEncryptionAlgorithm\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"idTokenEncryptionMethod\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"idTokenPublicEncryptionKey\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"clientJwtPublicKey\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"mTLSTrustedCert\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"mTLSSubjectDN\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"mTLSCertificateBoundAccessTokens\": {\n      \"inherited\": true,\n      \"value\": true\n    },\n    \"publicKeyLocation\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"userinfoResponseFormat\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"userinfoSignedResponseAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"userinfoEncryptedResponseAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"userinfoEncryptedResponseEncryptionAlgorithm\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"requestParameterSignedAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"requestParameterEncryptedAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"requestParameterEncryptedEncryptionAlgorithm\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"tokenIntrospectionResponseFormat\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"tokenIntrospectionSignedResponseAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"tokenIntrospectionEncryptedResponseAlg\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    },\n    \"tokenIntrospectionEncryptedResponseEncryptionAlgorithm\": {\n      \"inherited\": true,\n      \"value\": \"string\"\n    }\n  },\n  \"coreUmaClientConfig\": {\n    \"claimsRedirectionUris\": {\n      \"inherited\": true,\n      \"value\": [\n        \"Unknown Type: any\"\n      ]\n    }\n  }\n}"
    },
    "url": {
      "raw": "{{amUrl}}/json{{realm}}/realm-config/agents/OAuth2Client/{{postmanConfidentialClientId}}",
      "host": [
        "{{amUrl}}"
      ],
      "path": [
        "json{{realm}}",
        "realm-config",
        "agents",
        "OAuth2Client",
        "{{postmanConfidentialClientId}}"
      ]
    },
    "description": "Register a demonstration confidential client, used in the OAuth 2.0 flows section of the collection."
  },
  "response": [
  ]
}