Question: I have a very simple question that is essentially as stated in the title.

**When implementing a JWT authentication scheme that incorporates short-lived access tokens and longer term refresh tokens, should these two token types be signed with different secrets?**

I have been learning more about this authentication scheme recently and in my reading I didn't come across a strong opinion or conclusive answer to this question. Some brief Googling and searching Stack Overflow didn't produce any meaningful answers either.

Thank you for your time!

Answer: 
**Answer:** No

**Why?**

2 tokens we're speaking of are

1. access token
2. refresh token

Cryptographically there is no upper-bound on key-usage that I'm aware of for either HMAC, RSA or ECDSA. So signing with the same key is totally reasonable to protect from [existential forgery](https://en.wikipedia.org/wiki/Digital_signature_forgery).

However, if your access-token and refresh-token issuing endpoints are on separate servers, from a key-management security perspective you may wish to sign with different secrets to contain a compromise of one of the two secrets.
From cryptographic aspect I can agree with the accepted answer.

But one thing to think about is, that if you are using the same secret, you should care how you validate the refresh token. If you just check that the JWT is valid, one could send an access token as the refresh token and obtain a new access token from an previous valid access token.

So you should either use different secrets or care that you specify and validate a flag in the JWT body indicating if this is an access or refresh token.