See JSON object sent by okta-sdk-java on update

Hi,

I’m using okta-sdk-java to update apps in Okta from a JSON payload get from another tenant.

My issue is that updating an OIDC app doesn’t work when i’m using the .update() function, I’m getting HTTP 400, Okta E0000003 (The request body was not well-formed.).

So I must be missing something because if I’m parsing my object to a JSON String and send it with Postman I’m not getting any error and the app is updated.

But as there is no way to see the real json payload or request sent to Okta ( or if there is a way I didn’t find it), I’m kind of stuck here.

                    Application oidcApp = OIDCApplicationBuilder.instance()
                            .setName(name)
                            .setLabel(label)
                            .setGrantTypes(grantTypes)
                            .setResponseTypes(responseTypes)
                            .setApplicationType(applicationType)
                            .setTokenEndpointAuthMethod(authenticationMethod)
                            .setRedirectUris(redirectUris)
                            .buildAndCreate(okta);

                    oidcApp.put("status", status);
                    oidcApp.put("accessibility", accessibility);
                    oidcApp.put("visibility", visibility);
                    oidcApp.put("licensing", licensing);
                    oidcApp.put("features", features);
                    oidcApp.put("signOnMode", signOnMode);
                    oidcApp.put("credentials", credentials);
                    oidcApp.put("settings", settings);

                    Gson gson = new Gson();
                    String json = gson.toJson(oidcApp);
                    System.out.println(json);

                    oidcApp.update();

@Hekmil Did you test the operation in Postman? The below doc contains the samples to update an application. You may follow the example and test in postman first.
https://developer.okta.com/docs/reference/api/apps/#update-key-credential-for-application

As I said, yes I tried it with postman with my object converted to a JSON string and it worked.

String json = gson.toJson(oidcApp);

It means that .update() is doing more that it seems but as we can’t change client after defining the Application object I cannot intercept the payload to see what happened