Skip to content

Signed URL support #22

Closed
Closed

Description

@0x1618

Hello! I think it would be really cool to support signed URLs to prevent unwanted API usage from third parties. When you self-host the DiceBear API, it's often publicly exposed, which means anyone who has the URL to your instance can use it without authentication. Having a signature parameter that signs the whole URL using a symmetric key (e.g. hmac-sha256) would be extremely helpful to restrict access to authenticated requests only.

Example:

/10.x/constellation/svg?backgroundColor=101219&constellationColor=c3cdef&seed=123 ->
/10.x/constellation/svg?backgroundColor=101219&constellationColor=c3cdef&seed=123&exp=1700000000&sig=abc

Activity

  1. added a commit that references this issue on Nov 16, 2026
    28b7ad8
  2. FlorianKoerner commented on Nov 21, 2026

    @FlorianKoerner
    Member

    Hi @0x1618, thanks a lot for this idea! Signed URLs are here, and you can try them in v4.14.0-rc.5:

    docker pull dicebear/api:4.14.0-rc.5

    Set SIGNING_SECRETS and the avatar endpoints only answer URLs that end in a sig parameter. It works almost exactly like your example, and exp is in there as an optional expiry too:

    /10.x/constellation/svg?backgroundColor=101219&constellationColor=c3cdef&seed=123&exp=1700000000&sig=<hmac-sha256 of everything before &sig>
    

    The guide in the repo explains how to sign a URL, with examples in JavaScript, PHP, Python, Rust, Go, Dart and C#.

    I'd love to hear how it works for you. If something feels off, just tell me here, there's still time to change it before the final release.

  3. 0x1618 commented on Nov 21, 2026

    @0x1618
    Author

    @FlorianKoerner thanks! I tested the feature and it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions