FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    JWT populate with tenant information

    Scheduled Pinned Locked Moved
    Q&A
    2
    2
    384
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dominique.burnand
      last edited by

      Hi,

      Is there a way to populate the JWT with the tenant name? As far as I know, the place to add additional information to the JWT is the 'JWT Populate' lambda. In there I can access the user object. However that only holds the tenant-id, not the tenant-name.

      Workarounds which I see:

      • Store the tenant-name in the user data (feels unclean and we need to make sure it happens each time when a new user gets created)
      • Translate the uuid to the tenant name in the service which validates the JTW (adds overhead there)

      Is there an easy way to achieve my goal or do you see another workaround?

      1 Reply Last reply Reply Quote 1
      • danD
        dan
        last edited by

        Hiya,

        Yup, you've encountered a known limit of the lambda functionality. The two options you outline are the ones I'd consider. You could update the user data with the tenant name on create using a webhook, so maybe not as messy as you might think.

        The only other option would be to file a github issue requesting the tenant information be made available in the lambda: https://github.com/fusionauth/fusionauth-issues/issues

        There are some similar issues I'd suggest voting up if this is important to you:

        https://github.com/FusionAuth/fusionauth-issues/issues/571
        https://github.com/FusionAuth/fusionauth-issues/issues/267
        https://github.com/FusionAuth/fusionauth-issues/issues/229

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post