How to handle client_id and client_secret for Password Grant Tokens in Passport

前端 未结 2 1716
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 04:28

I am trying to figure out how to handle the Password Grant Tokens in Passport package. Should i store the client_id and client_secret in .env file or fetch the values direct

2条回答
  •  庸人自扰
    2021-01-05 04:45

    While you certainly can store the values inside your .env file, you should think these tokens as secrets you grant to other developers who want to use your API. What if everyday 50 developers want to register to use your API, will you add them by hand to your .env file? If it's only you / your company this kan be "ok", but I would store them in the database for scalability.

提交回复
热议问题