Retrieve a list of OpenIdConnectApplications (Java)

Hello,

I am trying to use v10.3.0 of the Okta SDK to retrieve a list of OpenIdConnectApplications. I specifically need this class because I am attempting to retrieve the contents of credentials.oauthClient.client_id. My team specifically would like to use the SDK for versioning control and potential to upgrade

I am trying to use the listApplications(q="label", null, ..., null) method to retrieve this list. The reason for this is we have ported existing client/secrets from AWS Cognito and have some issues doing lookups where we have duplicate names and where we saved existing client ids). The thought process is that if we can find an application by label, match it to it’s clientId, we could then get the appId for an operation ensuring we don’t accidentally have other conflicts.

Sample request
GET https://{okta-server}/api/v1/apps/{appId}

Response snippet
{ 
    ...
    "credentials": {
       "userNameTemplate": {...},
       "signing": {...},
       "oauthClient": {
          "autoKeyRotation": true,
          "client_id": "{client_id}", // Attempting to get this
          "token_endpoint_auth_method": "client_secret_post",
          "pkce_required": false
        }
     }
}

The Apps API docs makes it looks like I should be able to get the “full” Application, including the credentials sub object, but I am unable to get this using the SDK when I try something like:

(OpenIdConnectApplication) applicationApi.getApplication(appId, null) --> Cast class exception

I’ve tried a similar casting on v13.0.3 for the listApplications method, but we cannot use this version because this breaks a separate part of our app due to a bug where the OAUTH_AUTHORIZATION_POLICY is completely missing.

        List<OpenIdConnectApplication> apps = (List<OpenIdConnectApplication>)(Object)
                applicationApi.listApplications({app_label}, null, null, null, null, null);

When I try this casting on v10.3.0, I receive a list of Applications, but they are missing the credentials json. In version v12.x or 13.x, it works.

Is there any way for me to accomplish this casting in v10.3.0? We are hesitant to upgrade to v11.x because this feature/fix is required soon, and v11.x would require unforeseen refactors for the exception handling that wasn’t included in v10.x.

Thanks

Go ahead and close this conversation. We have worked around this issue

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.