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

    JWT public keys are empty

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    3
    815
    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.
    • S
      stacey
      last edited by

      Hey there… I’ve been searching for a solution to problem I am having with the /jwt/public-key endpoint. It seems there are no keys being returned. The response is

      {"publicKeys":{}}
      

      When I supply an application ID with the request, I get an exception

      The @JSONResponse field [response] in the action [class io.fusionauth.app.action.api.jwt.PublicKeyAction] is null. It cannot be null!
      

      Any insight on this? Am I missing a configuration setting somewhere? I would have expected maybe a default key would have been returned.

      J 1 Reply Last reply Reply Quote 1
      • J
        johnathon @stacey
        last edited by johnathon

        @stacey

        To confirm, you are trying to hit this endpoint to retrieve a public key, correct?

        In order to get this endpoint to publish/return your public key, you will need to either import or generate a key pair. I would review whether you are importing an existing key pair or generating a new one here: https://fusionauth.io/docs/v1/tech/core-concepts/key-master#importing-vs-generating

        Have you done this step yet? If not, once the pair is imported/generated correctly, this endpoint should return your public key.

        If it's still returning an error, please let us know.

        As for the @JSONResponse error, we should be handling that and you should be getting this response when hitting the same endpoint with the applicationId.

        {}
        

        I opened a bug here if you would like to track it. https://github.com/FusionAuth/fusionauth-issues/issues/1918

        source: https://fusionauth.io/community/forum/topic/404/i-imported-a-public-key-and-am-not-seeing-the-kid-in-the-jwks-endpoint

        Thanks and happy coding,

        Johnathon

        1 Reply Last reply Reply Quote 0
        • S
          stacey
          last edited by

          Thanks for the update!

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