Update applications with okta-sdk-nodejs

Hello,
I’m struggling to get the API to update applications within my tenant, while using the okta-sdk-nodejs.

const oktaProvider = require('@okta/okta-sdk-nodejs')
const okta = new oktaProvider.Client({
    orgUrl: <my tenant address>,
    token: <secret token>,
})
    const updateApplication = okta
        .updateApplication('application id', {
            name: 'oidc_client',
            label: 'testmyapp1',
            signOnMode: 'OPENID_CONNECT',
            settings: {
                oauthClient: {
                    client_uri: null,
                    logo_uri: null,
                    redirect_uris: ['http://localhost:3000/login'],
                    post_logout_redirect_uris: [],
                    response_types: ['code'],
                    grant_types: ['authorization_code'],
                    application_type: 'web',
                    issuer_mode: 'DYNAMIC',
                    idp_initiated_login: {
                        mode: 'DISABLED',
                        default_scope: [],
                    },
                    wildcard_redirect: 'DISABLED',
                },
            },
        })
        .then(res => console.log(res))
        .catch(err => console.log(err))

Anytime the above code runs, I get the following error back.

[OktaApiError: Okta HTTP 400 E0000001 Api validation failed: App Instance. ] {
  status: 400,
  errorCode: 'E0000001',
  errorSummary: 'Api validation failed: App Instance',
  errorCauses: [],
  errorLink: 'E0000001',
  errorId: 'oaeWdL8LSGeRLSyIn8iy4DAvg',
  url: 'mytenant address/api/v1/apps/appid',
  headers: Headers {
    [Symbol(map)]: [Object: null prototype] {
      date: [Array],
      'content-type': [Array],
      'transfer-encoding': [Array],
      server: [Array],
      'public-key-pins-report-only': [Array],
      'x-okta-request-id': [Array],
      'x-xss-protection': [Array],
      p3p: [Array],
      'content-security-policy-report-only': [Array],
      'content-security-policy': [Array],
      'report-to': [Array],
      'x-rate-limit-limit': [Array],
      'x-rate-limit-remaining': [Array],
      'x-rate-limit-reset': [Array],
      pragma: [Array],
      expires: [Array],
      'expect-ct': [Array],
      'x-content-type-options': [Array],
      'strict-transport-security': [Array],
      'cache-control': [Array],
      connection: [Array],
      'set-cookie': [Array]
    }
  }
}

When running update application with:

    const updateApplication = okta
        .updateApplication('application id', {
            name: 'oidc_client',
            label: 'testmyapp1',
            signOnMode: 'OPENID_CONNECT',
        })
        .then(res => console.log(res))
        .catch(err => console.log(err))

The application updates just fine, I just can’t seem to find a way to update the settings block successfully. Any help would be appreciated!

dependency version: @okta/okta-sdk-nodejs 6.6.0

Hi @sseekamp, are you able to make these changes using Postman, or do you get the same error?

Hi @louie these changes are being made with the Okta-sdk-nodejs 6.6.0. I can get the application to update with postman I suppose, but I want to be able to process and update with the sdk programatically.

Hi @sseekamp, could you please verify that the changes can be made with Postman? I’d like to see if the same issue occurs with Postman, or if it is specific to the SDK.