How generate a large expiration token


#1

Hi,

I have been looking for how generate a token customizing the expiration date on the documentation and I can’t see anything about. I don’t want to have my prisma server without protection but I want to generate a token with large expiration because only it is going to serve from a proxy server not for the clients directly. How can I do it?

Thanks.


#2

Hi,

You can generate the JSON Web token manually. Sign it with the service secret.

Here are more detailed instructions: https://www.prisma.io/docs/prisma-server/authentication-and-security-kke4/#management-api-token


#3

Hi @pantharshit00 , thanks!

But I can’t see any about how modify the expiration date, in the prisma token there aren’t extra options to can do it. Am I missing something?

Thanks again!


#4

Just change the exp field or completely removed it


#5

Doesn’t work. I have tried to remove exp property and change it duration with JWT Debugger Chrome Extension, and it returns me an invalid token error.

  "errors": [
    {
      "message": "Your token is invalid. It might have expired or you might be using a token from a different project.",
      "code": 3015,
      "requestId": "local:cjruewhxv001l0710waj2b8pb"
    }
  ]
}

How did you do it?

Thanks!


#6

#7

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.