Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing JsonWebKey.setX5c() method in 18.0.0 #1547

Closed
carlsandland opened this issue Aug 28, 2024 · 4 comments
Closed

Missing JsonWebKey.setX5c() method in 18.0.0 #1547

carlsandland opened this issue Aug 28, 2024 · 4 comments

Comments

@carlsandland
Copy link

carlsandland commented Aug 28, 2024

Describe the bug?

My code that creates an IDP dynamically calls this code to set the cert chain for the key from a PEM file, used to work fine:

var key = new JsonWebKey();
key.setX5c(Collections.singletonList(sanitizedx509CertStr));

when moving to 18.0.0 this method is not available in JsonWebKey class, but getX5c and it's underlying list property is still there. Please send help (or let me know if this is a bug). I need it to call oktaApi.createIdentityProviderKey(jsonWebKey), which wraps the POST to /api/v1/idps/credentials/keys

What is expected to happen?

My old code should compile.

What is the actual behavior?

It doesn't compile (missing method).

Reproduction Steps?

My current pom is:

  <dependency>
       <groupId>com.okta.sdk</groupId>
       <artifactId>okta-sdk-api</artifactId>
       <version>18.0.0</version>
  </dependency>
  <dependency>
      <groupId>com.okta.sdk</groupId>
      <artifactId>okta-sdk-impl</artifactId>
      <version>18.0.0</version>
      <scope>runtime</scope>
  </dependency>

Additional Information?

No response

Java Version

openjdk version "11.0.23" 2024-04-16 LTS
OpenJDK Runtime Environment Corretto-11.0.23.9.1 (build 11.0.23+9-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.23.9.1 (build 11.0.23+9-LTS, mixed mode)

SDK Version

18.0.0

OS version

Darwin csandlan-mac-0 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64

@carlsandland
Copy link
Author

Probably a result of readonly here from swagger:

x5c:
          description: X.509 certificate chain that contains a chain of one or more certificates
          type: array
          items:
            type: string
          readOnly: true

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Aug 29, 2024

Yes it was a spec issue, will get it fixed with the next spec update which requires a major release.

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Sep 20, 2024

@carlsandland with the above PR merge, 19.0.0 will be released soon. You will be able to do createIdentityProviderKey(..) with your X5c set like this:

IdentityProviderApi identityProviderApi = new IdentityProviderApi(client);
IdentityProviderKeysApi identityProviderKeysApi = new IdentityProviderKeysApi(client);

IdPCertificateCredential idPCertificateCredential = new IdPCertificateCredential();
idPCertificateCredential.setX5c(...);

identityProviderKeysApi.createIdentityProviderKey(idPCertificateCredential);

Ref: https://developer.okta.com/docs/api/openapi/okta-management/management/tag/IdentityProviderKeys/#tag/IdentityProviderKeys/operation/createIdentityProviderKey

@carlsandland
Copy link
Author

Thanks @arvindkrishnakumar-okta for following through on this, appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@arvindkrishnakumar-okta @carlsandland and others