# Allow custom digit length on OTP

**URL:** <https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712>\
**Category:** Feature Requests\
**Created:** [June 6, 2023, 5:08pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712 "2023-06-06T17:08:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mblancor](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/mblancor/32/1103_2.png) [@mblancor](https://vaultwarden.discourse.group/u/mblancor)\
**Post date:** [June 6, 2023, 5:08pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/1 "2023-06-06T17:08:18Z")

</div>

Hi everyone,

I see that some service providers (like Twilio / Sengrid) expect 7 digits instead of six which is the standard, so it would be good that when I configure an OTP, I could specify the length of it.

thanks for this fantastic project \<3

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [June 6, 2023, 5:10pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/2 "2023-06-06T17:10:30Z")

</div>

See [vaultwarden/.env.template at adf67a8ee887d21e104adfa8b6521d7971f5a1f1 · dani-garcia/vaultwarden · GitHub](https://github.com/dani-garcia/vaultwarden/blob/adf67a8ee887d21e104adfa8b6521d7971f5a1f1/.env.template#L231)

---

<div class="post-metadata">

**Author:** ![mblancor](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/mblancor/32/1103_2.png) [@mblancor](https://vaultwarden.discourse.group/u/mblancor)\
**Post date:** [June 6, 2023, 5:21pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/3 "2023-06-06T17:21:07Z")

</div>

Thanks for the quick reply BlackDex, I hadn’t seen it 🫢.

---

<div class="post-metadata">

**Author:** ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)\
**Post date:** [June 6, 2023, 5:45pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/4 "2023-06-06T17:45:16Z")

</div>

This is only for email OTP, I believe the poster is requesting the support for the client Bitwarden TOTP, which should support standard `&digits=7` parameter

OP see,

> **[Support TOTP auth parameters](https://community.bitwarden.com/t/support-totp-auth-parameters/37/6)**
>
> This will be available in the next versions of the apps. Supports parameters digits (1-10), algorithm (sha1, sha256, and sha512), period (\> 0) and secret (base32 key). Learn more about using otpauth:// urls here:...

Essentially though this should be provided by the key issuer at the time of TOTP registration. Possibly it would not be included if expecting to be used with their native authenticator app such as Steam. Either way though should be supported the same as the upstream Bitwarden clients, and as long as you specify the correct parameter for the digits you need you should be able to get the correct 7 digit TOTP code generated.

---

<div class="post-metadata">

**Author:** ![mblancor](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/mblancor/32/1103_2.png) [@mblancor](https://vaultwarden.discourse.group/u/mblancor)\
**Post date:** [June 12, 2023, 5:27pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/5 "2023-06-12T17:27:45Z")

</div>

As cksapp say, I’m requesting support for the client Bitwarden TOTP to register sendgrid and twilio TOTP

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [June 12, 2023, 5:38pm UTC](https://vaultwarden.discourse.group/t/allow-custom-digit-length-on-otp/2712/6 "2023-06-12T17:38:11Z")

</div>

That’s not something we can help with. That’s all client side and nothing on the server. The server doesn’t even know the TOTP string used.

Vaultwarden is only the server side API implementation of Bitwarden to which the clients connect.
