Add a copy-to-clipboard button to the API token creation form #8709

Closed
opened 2025-12-29 20:40:14 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Oct 3, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.6.3

Feature type

New functionality

Proposed functionality

On the API token creation form, add a button to conveniently copy the randomly-generated API token value to the system clipboard.

API token creation form

Use case

Convenience

Database changes

No response

External dependencies

No response

Originally created by @jeremystretch on GitHub (Oct 3, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.6.3 ### Feature type New functionality ### Proposed functionality On the API token creation form, add a button to conveniently copy the randomly-generated API token value to the system clipboard. ![API token creation form](https://github.com/netbox-community/netbox/assets/13487278/b8ffa826-c713-4f5b-8ca4-56309e68d215) ### Use case Convenience ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featuretopic: UI/UX labels 2025-12-29 20:40:14 +01:00
adam closed this issue 2025-12-29 20:40:14 +01:00
Author
Owner

@jsenecal commented on GitHub (Oct 5, 2023):

Isn't that already supported by netbox/templates/account/token.html#L20 and netbox/templates/account/token.html#L32 -> copy_content.html in the detail view of tokens?

If I understand properly, I think the end goal is to prevent the token to be retrieved after saving in the future. In that case we can create a custom form widget with a "copy" button for the key field.

This can be assigned to me if I understand the end goal properly.

@jsenecal commented on GitHub (Oct 5, 2023): Isn't that already supported by [netbox/templates/account/token.html#L20](https://github.com/netbox-community/netbox/blob/v3.6.3/netbox/templates/account/token.html#L20) and [netbox/templates/account/token.html#L32]( https://github.com/netbox-community/netbox/blob/v3.6.3/netbox/templates/account/token.html#L32) -> [copy_content.html](https://github.com/netbox-community/netbox/blob/v3.6.3/netbox/utilities/templates/builtins/copy_content.html) in the detail view of tokens? If I understand properly, I think the end goal is to prevent the token to be retrieved after saving in the future. In that case we can create a custom form widget with a "copy" button for the `key` field. This can be assigned to me if I understand the end goal properly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8709