Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

#5. OAuth 2.0 Flow – What Is A Refresh Token?

Posted on 02/08/2025 By admin

Understanding the role of a Refresh Token in the authorization process is important. We will learn about the refresh token and how it is used in OAuth 2.0 flow in this post.

A refresh token is a credential that is used to generate a new access token. In the OAuth 2.0 flow, the authorization server issues an opaque string i.e. access token representing the authorization on behalf of the resource owner to the client. An access token may have a duration of access (expiration time) as granted by the resource owner and enforced by the resource server and authorization server.

You can read more about an Access token here.

So when the access token is expired then instead of regenerating the authorization grant to get a new access token, we can use a refresh token to generate a new access token. An access token with a refresh token can be provided to the client by the authorization server. The client needs to generate a new access token by presenting a refresh token to the authorization server. The refresh token cannot be used as an access token.

But please note that issuing a refresh token is optional at the discretion of the authorization server. If the authorization server issues a refresh token, it is included when issuing an access token.

A refresh token is also an opaque string like an access token.

Image source – https://www.rfc-editor.org/rfc/rfc6749#section-1.5

The authorization server provides an access token and a refresh token (Optional) to the client (Step B). The Client uses the provided access token to access the protected resource until the token is expired (STep C, D, E, and F).

When an access token is expired, the client represents the provided refresh token to the authorization server (Step G). The authorization server will provide a new access token and maybe a new refresh token (Step H).

A leaked refresh token can put resource owners at risk. Generally, a refresh token is long-lived but it may expire as well. It depends on the authorization server and resource owner. A refresh token can be expired if not used for so long time or a possible misuse is detected by the authorization server.

Once a refresh token is expired, the client needs to ask a resource owner to authenticate again.

Thanks for reading. Kindly comment for any feedback and suggestions.

Uncategorized

Post navigation

Previous Post: Selenium Interview Question 11 – Which Class Implements Alert Interface in Selenium WebDriver?
Next Post: Locating Dynamic Web Elements In Selenium WebDriver : Conditional Xpaths And CSS

Related Posts

Learn About Less Talked & Used XPath Function – concat() Uncategorized
Introduction to JSONassert Uncategorized
June 24, 2018 – Make Selenium Easy Uncategorized
December 12, 2018 – Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
April 5, 2018 – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark