okta/okta-sdk-nodejs

Types for OpenIdApplications

christineyost opened this issue · 3 comments

User story

As a developer, I want OpenIdApplication types with optional fields so that it is not required to set every field when creating an OpenIdApplication

Proposed solution

This documentation seems to indicate that a lot of settings are nullable when creating an OpenIdApplication. However when using this package in a typescript project I'm running into errors like the following that indicate that the OpenIdConnectApplicationSettingsClient type requires all fields to be set, whether or not they are nullable. I'd propose to make all the fields that are marked as nullable on the linked documentation optional in the type definition. It would be nice to have this done in all type definitions.

Type '{ application_type: OpenIdConnectApplicationType; client_uri: string; consent_method: string; grant_types: OAuthGrantType[]; initiate_login_uri: string; logo_uri: string; redirect_uris: string[]; response_types: OAuthResponseType[]; }' is missing the following properties from type 'OpenIdConnectApplicationSettingsClient': issuer_mode, jwks, policy_uri, post_logout_redirect_uris, and 2 more.ts(2740)

I also noticed that the client supplied by this package returns an Application object from the client.createApplication method. We need fields that are not included on the Application type, but are included on the OpenIdApplication type. Is it possible to get back an OpenIdApplication rather than just an Application?

Alternatives considered

Additional information

We are hoping to start utilizing the newly supplied types from this package in our backend application that is responsible for creating OpenIdApplications in Okta. Thanks for supplying the types! Our backend solution currently uses custom types that were created perhaps before types were supplied for this package. We currently aren't setting all of the fields that are marked as nullable in the documentation linked above, but our application is successfully creating OpenIdApplications in Okta.

Thanks for submitting this issue.
Internal ref: OKTA-414840

@christineyost would you be able to check if this works for you as expected in 6.0.0?

Closing as resolved