Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
jsejcksn
10 months agoNew Contributor
Copy secret reference (using ID values)
This applies to all platforms (not just Mac), but I didn't see a community category for "all platforms", so I'm choosing Mac because it seems to have the highest user activity
Perhaps I've missed some documentation, but I don't find a way to copy a https://developer.1password.com/docs/cli/secrets-reference-syntax/ using the desktop app. This seems like a basic and essential task during development.
What I want is this format:
op://vault_id/item_id/section_id/field_id
or if the value isn't in a section:
op://vault_id/item_id/field_id
How can I do that easily — and get a secret reference defined by ID values (which should be immutable — vs. name values which can be modified)?
More context:
I find some ways to construct the URL manually (but this is not ideal):
A URL can be copied which includes the vault and item ID among other query parameters:
I get one in a format like this:
https://start.1password.com/open/i?v={VAULT_ID}&i={ITEM_ID}
However, that's not enough as it doesn't include the section/field, and would need to be manually edited or processed by other tooling as an additional step to get the required output.
I can also use "Copy item UUID" and then paste that as an argument to a manually-typed CLI command to get much more than what's needed:
% op --format=json item get x5k2wndiih6cmw2rugl7ol442i
{
"id": "x5k2wndiih6cmw2rugl7ol442i",
// --- snip ---
"vault": {
"id": "{REDACTED_VAULT_ID}",
// --- snip ---
},
// --- snip ---
"fields": [
// --- snip ---
{
"id": "credential",
"type": "CONCEALED",
"label": "credential",
"value": "abc123",
"reference": "op://{REDACTED_VAULT_NAME}/API Credential/credential"
},
// --- snip ---
]
}
However, this still involves either manually copying+pasting IDs or using other tooling to parse and create the required output.
The JSON does include a reference
value for the target field, but the reference is built using names, which isn't satisfactory for the reasons described previously.
For the example above, what I want to copy to the clipboard is the following (where {VAULT_ID}
is replaced by the actual vault ID):
op://{VAULT_ID}/x5k2wndiih6cmw2rugl7ol442i/credential
I think that if the boolean option is enabled at Settings > Advanced > Show debugging tools:
then there should be an option to copy a complete ID-based secret reference for every field in its contextual menu:
This is a re-posting of previous issue — the 1Password team stopped responding and it was closed without comment:
https://1password.community/discussion/139642/copy-secret-reference-using-id-values
1Password Version: 8.10.48
Extension Version: Not Provided
OS Version: macOS 15.0.1
Browser: Not Provided
10 Replies
- XoggyNew Contributor
Just want to add a +1 to this thread / ticket. being able to chose to always get UUID's when using the Copy Secret Reference would help a lot :)
- 1P_Dave
Moderator
- 1P_Dave
Moderator
Thanks for the reply. If the change is implemented you'll see it noted in our release notes: 1Password Releases
If our product team requests any other information from your end then I'll definitely reach out in this thread.
-Dave
- jsejcksnNew Contributor
1P_DaveHi: Is there any update here? I think users expect to receive updated information about issues in the same context/channel as the reported issue. I don't think it's reasonable to expect users who report specific issues to read the full content of every release notes post in order to make a determination about whether the specific reported issue has been addressed.
- 1P_Dave
Moderator
Thanks for following up! The feature request is still open with the team and I don't have any updates to share.
For the time being, I've moved your discussion to the developer's section of the community in case other developers are able to share any workarounds that they've implemented for this on their end.
-Dave
- 1P_Dave
Moderator
I'm sorry for the misunderstanding. I understand that you're looking for the 1Password app to provide a more stable version of the secret reference that is based on field IDs rather than field names since field names can be changed by a user who can edit a particular item and break the secret reference.
I don't have any updates to share on the feature request that my colleague filed on your behalf however I've let the team know that you'd still like to see this functionality be added to 1Password in the future. 🙂
-Dave
ref: PB-44364766
- jsejcksnNew Contributor
1P_Dave Please review the previous post (including the comments by users marked with "1Password" next to their name), then review the all of the details in this post. It explains how the existing functionality doesn't offer an immutable, ID-based reference. If you still need clarity after reviewing, let me know!
- 1P_Dave
Moderator
Hello jsejcksn! 👋
I'm sorry that your post was missed. You can enable the ability to copy a field's Secret Reference from the desktop app by first turning on the integration with 1Password CLI: Get started with 1Password CLI Developer
Once this is done, you'll see an option to Copy Secret Reference when you hover over a field in the desktop app and click on the down arrow:
Let me know if I misunderstood. 🙂
-Dave
- BugBrotherNew Contributor
Thanks!