Add --raw flag to output unmodified JSON token response#149
Closed
dcluna wants to merge 1 commit intoSecureAuthCorp:masterfrom
Closed
Add --raw flag to output unmodified JSON token response#149dcluna wants to merge 1 commit intoSecureAuthCorp:masterfrom
dcluna wants to merge 1 commit intoSecureAuthCorp:masterfrom
Conversation
Preserves the raw JSON bytes from the token endpoint response so that fields not modeled in TokenResponse (e.g. email, environment_id, legal_entity_name) are available when --raw is passed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
Contributor
|
Thanks for the patch. Would #150 work for you instead? It keeps the unknown fields but doesn't require a |
Author
@mbilski Thanks, I just tested it and it does what I expect, and does not require an extra flag. Would prefer that approach. I'll close this in favor of that PR, thanks for the quick turnaround. |
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.
Preserves the raw JSON bytes from the token endpoint response so that fields not modeled in TokenResponse (e.g. email, environment_id, legal_entity_name) are available when --raw is passed.
My use case for this is that one of the OAuth providers I work with returns some data in the response that is important for my application, for example, in this payload:
{ "access_token": "token", "email": "me@email.com", "environment_id": "envid-token-here", "environment_name": "oauth environment", "expires_in": 3600, "family_name": "Smith", "given_name": "John", "legal_entity_id": "legal-entity-id-token-here", "legal_entity_name": "oauth environment provider", "mode": "None", "refresh_token": "ref-token", "refresh_token_expires_in": 31536000, "token_type": "Bearer", "user_id": "uid-token-here" }The
environmentandlegal_entityfields are important for my application, and they should be retrieved from this endpoint.I'll understand if there are other concerns (I assume security must be one of them) for not including this in the CLI, but just wanted to float the idea and see the feedback.