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

    using fusionauth to generate a jwt that is able to be used with google firebase customToken authentication.

    Scheduled Pinned Locked Moved Solved Q&A
    4 Posts 2 Posters 2.4k Views
    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.
    • N
      nicholas.tsaoucis
      last edited by

      Hi,

      I'm trying to get fusionauth to be the authentication handler for my system.
      I want to be able to use the token generated by fusionauth to be able to log into firebase using firebase.auth().signInWithCustomToken(token)

      I have setup my public and private keys correctly and adjusted the require claims in the jwt populate lambda, however there is one thing that is blocking this from being possible now.

      fusionauth has 3 claims that are unable to be modified.
      exp, iat, sub
      https://fusionauth.io/docs/v1/tech/lambdas/jwt-populate/

      but firebase requires sub to be the google service account for your project.
      https://firebase.google.com/docs/auth/admin/create-custom-tokens

      From what I can see, sub in the jwt in fusionauth is the users unique id.

      the google requirements provide uid as the unique identifier to be required in the jwt payload.

      Is there a way to make fusionauth look for uid in the jwt instead of sub so I can get this to work? Or am I now at an impass?

      Does anyone have any suggestions for a better way to do what im trying to do here?

      1 Reply Last reply
      Reply Quote 0
      • N
        nicholas.tsaoucis
        last edited by

        I've been working with v1.29.4
        I noticed in v1.30.0 the jwt vending machine api was added.
        In the github topic for it, it states that the user defines the entire claim.
        Are there any claims that are protected with this?

        I'm thinking this might be a solution that I could use to do what I'm trying to do.

        1 Reply Last reply
        Reply Quote 0
        • N
          nicholas.tsaoucis
          last edited by

          I experimented with the /api/jwt/vend and it does exactly what I need it to do.
          creating a temporary JWT using a key saved in keymaster which allows access to all claims (only locked ones were the key life related ones)
          solved perfectly.

          joshuaJ 1 Reply Last reply
          Reply Quote 1
          • N nicholas.tsaoucis has marked this topic as solved on
          • joshuaJ
            joshua @nicholas.tsaoucis
            last edited by

            @nicholas-tsaoucis

            Glad you figured this out!

            Thanks,
            Josh
            FusionAuth

            1 Reply Last reply
            Reply Quote 0
            • danD dan moved this topic from Q&A on
            • danD dan moved this topic from Frequently Asked Questions (FAQ) on

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post