Closed s3rj1k closed 3 months ago
Thank you for sharing this use case. We have OTP support on our short roadmap.
@s3rj1k Would you also be ok with getting the OTP in some other way than using secret references, like for example:
item, err := client.Items.Get("my_OTP_item_id")
if err != nil {
panic(err)
}
var myTOTP string
for _, f := range item.Fields {
if field.Type == onepassword.FieldTypeOTP {
myTOTP = field.value
}
}
Would you also be ok with getting the OTP in some other way than using secret references
I would be ok with any working solution as this is not any kind of performance related solution in my case.
(not related to current issue) also if possible, please provide a working boilerplate for main
function, I did try to run some examples with exported SA token, it worked for CLI op
and did not for example code, erroring with some token serialization errors.
I did try to run some examples with exported SA token, it worked for CLI op and did not for example code, erroring with some token serialization errors.
Yes this is a identified bug that we recently discovered regarding creating service account tokens through the CLI. An internal issue has been brought up and we will let you know when this gets addressed.
A workaround would be creating a service account token through the 1Password website.. the steps can be found here: https://developer.1password.com/docs/service-accounts/get-started
@MOmarMiraj I see, thanks for info, will try again when OTP support will be added to SDK
@AndyTitu
We have OTP support on our short roadmap.
Do you have some time estimates for that? (Just to understand how long of a wait)
it worked for CLI op and did not for example code, erroring with some token serialization errors.
We recently discovered that service account tokens generated by the CLI aren't serialised the right way, so only the CLI knows how to deserialise them. To quick fix your issue, you can generate an SA token from the web UI.
In the meantime, we're working on that CLI issue.
Edit: Oh, I see Omar answered this already
Do you have some time estimates for that? (Just to understand how long of a wait)
Can't offer any strong commitments, but I'd say it's in the span of the next couple of months.
Hi @s3rj1k
As of v0.1.0-beta.12 of the Go SDK, you are now able to get/write OTP field information using the Item API.
If you have any more issues, please feel free to create another issue.
Use Case
I am trying to automate VPN connection as systemd-service and in need of the ability for SDK to handle OTP links like below
Requirements and desired behavior
Bare-minimal code support to fetch OTP data.
Additional information
Would be nice to have a working example code for OTP fetching.