# Assign leases to secrets

**URL:** <https://discuss.hashicorp.com/t/assign-leases-to-secrets/27891>\
**Category:** Vault\
**Created:** [August 6, 2021, 9:17am UTC](https://discuss.hashicorp.com/t/assign-leases-to-secrets/27891 "2021-08-06T09:17:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim.le\_large](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tim.le_large/32/18898_2.png) [@tim.le\_large](https://discuss.hashicorp.com/u/tim.le_large)\
**Post date:** [August 6, 2021, 9:17am UTC](https://discuss.hashicorp.com/t/assign-leases-to-secrets/27891/1 "2021-08-06T09:17:54Z")

</div>

Hello,  
We have a database engine running that creates dynamic secrets.  
Now we want to revoke a lease by only knowing the secret username.  
How can we assign this username to the lease token?

---

<div class="post-metadata">

**Author:** ![mikegreen](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mikegreen/32/3160_2.png) [@mikegreen](https://discuss.hashicorp.com/u/mikegreen)\
**Post date:** [August 6, 2021, 3:51pm UTC](https://discuss.hashicorp.com/t/assign-leases-to-secrets/27891/2 "2021-08-06T15:51:08Z")

</div>

> [@tim.le\_large](#):
>
> secret username

The database cred username? Unsure what you mean by the `secret username`.

You can lookup the leases with  
`vault lease lookup database/creds/my-role/<lease_id_here>`
