refactor: obo-exchange logics after moving them to library#101
Conversation
| Aliases: []string{"obo"}, | ||
| Short: "On-Behalf-Of token exchange.", | ||
| Long: `On-Behalf-Of token exchange: exchange a user access token for a new token. Do NOT send OBO access tokens to frontend clients.`, | ||
| Long: `On-Behalf-Of token exchange: exchange a user access token for a new token. Do NOT send OBO access tokens to frontend clients.`, |
There was a problem hiding this comment.
We should change the long description. Remove the Do NOT send OBO access tokens to frontend clients..
It is not the concern of our CLI to be teaching security best practices.
Modify the message to reference rfc8693 since the obo name is more of an Adobe convention
|
Good PR, please update that message, and I'll merge the PR |
| switch { | ||
| case i.URL == "": | ||
| return fmt.Errorf("missing IMS base URL parameter") | ||
| case i.ClientID == "": |
There was a problem hiding this comment.
Please, keep the client ID & client secret validations here for consistency.
After thinking carefully, I don't think the scopes are mandatory though. It may not make any sense but the CLI should support it.
There was a problem hiding this comment.
This is an old one, I updated imscli to wrap errors with %w all over the place, would you do this here too? :)
refactor: obo-exchange logics after moving them to library (adobe#101)
refactor: obo-exchange logics after moving them to library (adobe#101)
Description
Moved the On-Behalf-Of token exchange logic out of imscli and into the ims-go library. imscli no longer does the raw HTTP call to IMS for OBO; it uses ims-go’s client instead. The dependency go updated so this project pulls in a version of ims-go that includes that code. The CLI still exposes the same OBO command; only where the logic lives changed.
Related Issue
Motivation and Context
The OBO flow was previously implemented inside imscli with direct HTTP calls to IMS, which duplicated protocol details that really belong in the shared ims-go client. Duplication makes it harder to keep behavior aligned with other Adobe tooling and increases maintenance whenever IMS endpoints or error handling change. The logic has been moved into github.com/adobe/ims-go so there is a single, versioned place for OBO support.
How Has This Been Tested?
Manually: I ran the On-Behalf-Of exchange using this CLI against our IMS environment, verified a successful response, and confirmed the returned access token behaved as expected for the intended use case.
Types of changes
Checklist: