feat: support specifying client_id on oauth2 client creation#128
Merged
feat: support specifying client_id on oauth2 client creation#128
Conversation
Allow users to specify a custom `client_id` when creating an OAuth2 client resource, matching the Ory API capability. The field is Optional+Computed with RequiresReplace, so changing it forces recreation. Closes #121
Contributor
There was a problem hiding this comment.
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
lovelinuxalot
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Support specifying a custom
client_idwhen creating OAuth2 client resources, matching the Ory API's existing capability. This allows users to maintain consistent naming conventions across environments (e.g., migrating from self-hosted Hydra to Ory Network).Related Issues
Fixes #121
Type of Change
Checklist
make test)make format)Testing
Changes
Schema (
internal/resources/oauth2client/resource.go):client_idattribute fromComputedtoOptional+ComputedRequiresReplace()plan modifier (changing client_id forces recreation)Create (
internal/resources/oauth2client/resource.go):client_idto the Ory API on creationTests (
internal/resources/oauth2client/resource_test.go):TestAccOAuth2ClientResource_withCustomClientIDcovering create, import, and update with a custom client_idDocumentation:
templates/resources/oauth2_client.md.tmplwith Custom Client ID sectionexamples/resources/ory_oauth2_client/resource.tfAcceptance Test Results
All 9 OAuth2 client acceptance tests pass:
Security Scans
All pass clean:
make sec(govulncheck, gosec, gitleaks) - 0 issuesmake sec-trivy- 0 findingsmake licenses- passed