Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding URLs to LOGIN items not working #49

Open
gaborpeter opened this issue Jan 5, 2022 · 6 comments
Open

Adding URLs to LOGIN items not working #49

gaborpeter opened this issue Jan 5, 2022 · 6 comments
Labels
documentation Improvements or additions to documentation tracked Issue is tracked in 1Password's internal ticketing system as well.
Milestone

Comments

@gaborpeter
Copy link

Summary

After adding a LOGIN item with Ansible, and then visiting the site with the browser, 1Password client was not pulling it up as a suggestion even though the item was present and URL was correct.

Use cases

I followed the documentation how to create the item:

- name: Create 1pass item for admins
  onepassword.connect.generic_item:
    vault_id: "***"
    title: "Admin access"
    category: login
    state: present
    fields:
      - label: Username
        value: "admin"
        field_type: string
      - label: Password
        value: "***"
        field_type: concealed
      - label: website
        value: "https://yourdomain.com/login"
        field_type: url
  no_log: true

It did successfully create the item, but it added it under an empty "section" even though in the definition no section assignment was requested. After analyzing the tool I've seen that, you can add the URL's outside of sections and when they are placed there (kind of root level) then it works like a charm.

Proposed solution

I found in the 1Password API documentation that there is an "url" property for each item, which can be used. So when I added an item as follows, it did the trick and 1Password client suggested the item after properly when visiting the URL:

- name: Create 1pass item for admins
  onepassword.connect.generic_item:
    vault_id: "***"
    title: "Admin access"
    category: login
    state: present
    urls: 
      - "https://yourdomain.com/login"
    fields:
      - label: Username
        value: "admin"
        field_type: string
      - label: Password
        value: "***"
        field_type: concealed
  no_log: true

Probably this could be added to the documentation.

@verkaufer verkaufer added the documentation Improvements or additions to documentation label Jan 6, 2022
@verkaufer
Copy link
Member

Hey @gaborpeter - thanks for reporting this. We definitely should highlight the difference between urls at the root level and adding a url as a field.

I'll make sure this is included in the next update.

@verkaufer verkaufer added this to the 2.3 milestone Jan 6, 2022
@gaborpeter
Copy link
Author

Thank you @verkaufer !
Is it possible to define the label of the URL as well?
1Password API documentation says the urls field is an “Array of URL objects containing URLs for the item.”
However when I tried to use array of objects here I got undesired JSON object-ish value at the end, seems like this module only works at the moment with array of strings. Could you have a look on that please?

@verkaufer
Copy link
Member

Could you open that as a separate issue? Then we'll definitely see what we can do :)

@gaborpeter
Copy link
Author

In fact I realised, even the 1Password API doesn't support adding labels to URL objects, so first I'll try my luck there. Once the API supports it I'll raise a ticket here. Thanks :)

@edif2008 edif2008 changed the title Adding URLs to LOGIN items not working [7] Adding URLs to LOGIN items not working Feb 8, 2022
@edif2008 edif2008 added the tracked Issue is tracked in 1Password's internal ticketing system as well. label May 30, 2022
@edif2008 edif2008 changed the title [7] Adding URLs to LOGIN items not working Adding URLs to LOGIN items not working May 30, 2022
@edif2008
Copy link
Member

edif2008 commented Jun 8, 2022

Hey @gaborpeter,

Starting with Connect 1.5.1, 1Password API supports adding label to autofill URL objects.
There is still some work needed to update the Ansible Collection to support this feature.
We are tracking this issue and hope to add this feature in the future. 😊

Thank you for your patience.

@gaborpeter
Copy link
Author

Thank you it is indeed great news, will help to keep things more organised.
Have a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation tracked Issue is tracked in 1Password's internal ticketing system as well.
Projects
None yet
Development

No branches or pull requests

3 participants