Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

#6. OAuth 2.0 Flow – Role Of Refresh Token in OAuth 2.0 Flow

Posted on 02/19/2025 By admin

A refresh token is a credential that is used to generate a new access token. I have already explained about Refresh Token in the previous post. In this post, we will learn when and how a Refresh token is used in OAuth 2.0 flow.

Do not forget to subscribe to my channel to support.

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

Before you know more about the role of the refresh token in the OAuth 2.0 flow, you must be aware of OAuth 2.0 flow. Do not worry if you are not aware. Click on the below link to learn about OAuth 2.0 flow –

#1. OAuth 2.0 Flow – How Does It Work?

A Client requests authorization from the resource owner and receives an Authorization grant after successful authentication by the resource owner. This is shown as combined in Step A above.

The client presents the received Authorization grant to the Authorization server and requests for the Access token. The Authorization server verifies the client and authorization grant and issues the access token and refresh token to the client on successful validation. This is shown in Step B in the above flow diagram.

Now the client requests the resource server to provide access to the protected resources of the resource owner by presenting the received access token. The resource server validates the provided access token and provides protected resources for the resource owner. This is shown in Steps C and D.

So the client needs to present an access token to the resource server every time they request the protected resource. An access token has a lifespan and is expired after some fixed time. When the resource server finds that the presented access token is expired then the resource server returns the invalid token error and does not provide access to the protected resource. This is shown in Steps E and F.

At this stage, the client needs to obtain a new Access token. Now the refresh token comes into the picture. The client presents the received Refresh token to the authorization server. The authorization server authenticates the client and validates the refresh token. On successful validation, a new access token is provided to the client. Optionally a new refresh token can also be provided. In this case, the old refresh token will be expired and the client needs to use a new refresh token to generate a new access token once expired. This is shown in Steps G and H.

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

Uncategorized

Post navigation

Previous Post: TestNG Tutorials 14: Can We Overload Methods In TestNG Class?
Next Post: Learn Selenium With Quiz – Basic Level 4

Related Posts

May 20, 2018 – Make Selenium Easy Uncategorized
OverloadedParaTestNg – Make Selenium Easy Uncategorized
How To Upload A File In Selenium Webdriver Uncategorized
staleExc – Make Selenium Easy Uncategorized
Postman Tutorial Part 15 – Adding Automation Test Scripts In Postman Uncategorized
Frequently Asked Java Program 11: Find Position Of Letter In Alphabet 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