Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prisma token exp option when it's generated #4016

Closed
marticrespi opened this Issue Feb 7, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@marticrespi
Copy link

commented Feb 7, 2019

Is your feature request related to a problem? Please describe.
I would like to add the expiration time on the token when we generating it or avoid its generation. If I generate one with prisma token, it's valid one week, and I would like to generate a token that doesn't expires. If I modify this generated token with, for example, JWT Debugger and remove or change the exp property, prisma always respons me with an 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"
    }
  ]

Describe the solution you'd like
I would like to a persistent token, because my prisma server will not be public, only it will be requested through another proxy server but I want a token to do it that it doesn't expires to protect it a little.

@pantharshit00

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

Ok you can surely generate one with https://jwt.io

Here are the steps:

  1. open https://jwt.io
  2. generate a new token and paste it in the debugger
  3. now modify the exp to a very long date on the decoded panel(It is a UNIX timestamp)
  4. Now paste your service secret(it is in prisma.yml) in the secret section
  5. Copy the new token from the encoded section
@Eiskis

This comment has been minimized.

Copy link

commented Feb 22, 2019

Even though this is closed, wanted to leave a note here for the generations that come after me:

Don't use whitespace in your secret: there seems to be inconsistencies when Prisma generates/matches a token to the secret if you do. I spend a few hours trying to figure out why only Prisma-generated token would work, but turns out everything was good to go once I changed to a new secret without whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.