---
title: "Discussion on \"Access Token, Refresh token, and Refresh Token Rotation\" | Hashnode"
description: "Discussion on \"Access Token, Refresh token, and Refresh Token Rotation\". What is Access Token?\nAccess tokens are credentials encrypted using the JSON web token (jwt), access token contains data that grant access to protected resources on the server. The client (browser or app) is expected to attach the token to protected ..."
url: "https://hashnode.com/posts/access-token-refresh-token-and-refresh-token-rotation/62f0303cdfc2b1556588467e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Access Token, Refresh token, and Refresh Token Rotation](https://maytheu.hashnode.dev/access-token-refresh-token-and-refresh-token-rotation?utm_source=hashnode&utm_medium=feed)

What is Access Token? Access tokens are credentials encrypted using the JSON web token (jwt), access token contains data that grant access to protected resources on the server. The client (browser or app) is expected to attach the token to protected ...

Aug 7, 2022 · 2 min read · maytheu.hashnode.dev  
Read the article

-   [#access-token](https://hashnode.com/tag/access-token)
-   [#jwt](https://hashnode.com/tag/jwt)
-   [#apis](https://hashnode.com/tag/apis)

## Written by

[mathew adetunji](https://hashnode.com/@maytheu)

@maytheu

  
[View profile](https://hashnode.com/@maytheu)

I am a full stack javascript developer

## Responses 1

Markdown supported · ⌘↵ to post

[José Pablo Ramírez Vargas](https://hashnode.com/@webJose)

[Dec 11, 2022](https://hashnode.com/posts/access-token-refresh-token-and-refresh-token-rotation/62f0303cdfc2b1556588467e/comment/639572779fa713176ab9d979)

Don't save tokens in the database. It is the same as saving a user's password in clear text.

[mathew adetunji](https://hashnode.com/@maytheu)

[Dec 12, 2022](https://hashnode.com/posts/access-token-refresh-token-and-refresh-token-rotation/62f0303cdfc2b1556588467e/comment/639572779fa713176ab9d979#reply-6397330815750808b26a0716)

Thanks for the comment and for pointing that out, how should token be handled without using third-party solutions?

[José Pablo Ramírez Vargas](https://hashnode.com/@webJose)

[Dec 12, 2022](https://hashnode.com/posts/access-token-refresh-token-and-refresh-token-rotation/62f0303cdfc2b1556588467e/comment/639572779fa713176ab9d979#reply-639747d215750808b26a0bc1)

[mathew adetunji](https://hashnode.com/@maytheu) Hi. Generally speaking, the safest way to invalidate tokens is by demanding a specific minimum `issued at` time.

I explain the logic behind this invalidation method [here](https://webjose.hashnode.dev/invalidating-json-web-tokens-jwt-the-right-way). This can be refined to apply to refresh tokens only, if you wish, or invalidating per token type.

You'll also see **alternative 1** that tells you to key the tokens. Then you can more safely save token keys, not tokens. I discourage this path, though, because of the extra administrative work around maintaining the keys.
