okta / okta-sdk-golang

A Golang SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
https://github.com/okta/okta-sdk-golang
Other
175 stars 143 forks source link

wip: add `JWT` as possible `AuthorizationMode` #319

Closed ericnorris closed 10 months ago

ericnorris commented 2 years ago

Summary

This is a proof-of-concept PR in order to start a discussion around allowing users to specify pre-signed JWTs in the SDK, with the end goal being for it to be possible to use pre-signed JWTs in the Okta Terraform provider.

~I will update this description with a link to the matching PR in the Terraform provider once I have submitted it.~ See https://github.com/okta/terraform-provider-okta/pull/1237.

As a reminder for context: we'd like to explore using the Okta Terraform provider in an environment where the private key is opaque to us, that is, we have a mechanism for signing JWTs with some private key, but we don't know the actual value of the private key, and so we cannot configure the provider (nor the SDK) with the private key directly.

The change to the SDK is relatively minor; instead of always generating the JWT the code can now optionally use the WithToken configuration option as the JWT. I'm not tied to the exact implementation below, and would be open to a new configuration option, etc.

Type of PR

Test Information

There are no tests for this as it is a proof-of-concept, but I would absolutely add tests in order to get this merged.

Signoff

monde commented 2 years ago

As the API supports this, the SDK should as well. We need to write some tests around this PR and as well as explanation and usage documentation in the README.

github-actions[bot] commented 2 years ago

This PR has been marked stale because there has been no activity within the last 28 days. To keep this PR active, remove the stale label.

duytiennguyen-okta commented 10 months ago

This is now supported in v3