我开发了使用 Firebase 作为外部身份验证服务的 phoenix 应用。我用Joken图书馆。它要求我使用函数 with_signer需要一个加密 key 。我想这是 Firebase 签署 JWT 的 key 。问题是——我的假设正确吗?更重要的是 - 我在哪里可以找到这个 key ?
最佳答案
Firebase 应在众所周知的地址发布公钥,您可以使用该公钥来验证 JWT。
docs建议:
Finally, ensure that the ID token was signed by the private key corresponding to the token's kid claim. Grab the public key from https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com and use a JWT library to verify the signature. Use the value of max-age in the Cache-Control header of the response from that endpoint to know when to refresh the public keys.
关于firebase - 在哪里可以找到 JWT 签名所用的 key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50078588/