Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

#2. OAuth 2.0 Flow – Authorization Grants And Their Types

Posted on 02/19/2025 By admin

I have explained the Flow of OAuth 2.0 in the previous post. In Step B – Receive Authorization Grant, I mentioned that when A Client requests authorization from the resource owner and the resource owner authenticates successfully then an Authorization grant will be received by the Client. We will learn more about Authorization grants and their types in this post.

Video tutorials help in better learning. You must watch the video below. But it is always a good practice to read and understand the articles as well.

The authorization server is an important role in OAuth 2.0 flow which provides an access token to a client by receiving and validating an authorization grant. An authorization server is an intermediary between a client and a resource owner.

Let’s try to understand this with an example. If you want to signup/in on Spotify with your Google account then Spotify navigates you to the Google account page where you need to provide your Google account credentials. This page acts as an authorization server for Google here.

The client needs to register with the authorization server so that the client can direct the resource owner to an authorization server instead of requesting authorization from the resource owner directly.

The authorization server may be the same server as the resource server or a separate entity. A single authorization server may issue access tokens accepted by multiple resource servers.

An authorization grant is a credential representing the resource owner’s authorization. The client can use the received authorization grant to get an access token from the authorization server. Once the client receives the access token then it can access the resource owner’s protected resource. So you can understand here that getting the Authorization grant is the starting point.

There are four types of Authorization Grants:-

  1. Authorization code
  2. Implicit Grant
  3. Resource Owner Password Credentials
  4. Client Credentials

The client directs the resource owner to an authorization server. Then the authorization server authenticates the resource owner and obtains authorization. After this client is redirected to the client with an authorization code.

Since the resource owner only authenticates with the authorization server, the resource owner’s credentials are never shared with the client.

An example is as below –

https://localhost:8080/?state=state_parameter_passthrough_value&code=4/0AWgavdfoNkUkCHma6g1lO9-yjKYlJNrYylO7fRE_shjJK1AGLEkZrttKPpXh1Nw5WeYmj7KA&scope=https://www.googleapis.com/auth/drive.metadata.readonly

The authorization code has the ability to authenticate clients and safer transmission of the access token to the client.

The implicit grant is a simplified authorization code flow in which an access token is issued directly instead of an authorization code. It is optimized for clients implemented in a browser using a scripted language like JavaScript. The grant type is implicit, as no authorization code is issued.

When issuing an access token during the implicit grant flow, the authorization server does not authenticate the client. The access token can be exposed to other applications and resources owner in this flow. But it improves the efficiency and responsiveness of clients as there is no extra step to obtain an access token.

It does not support the issuance of a refresh token.

The Microsoft identity platform supports the OAuth 2.0 implicit grant flow.

The credential i.e. username and password of the resource owner is used as an authorization grant to obtain an access token. This grant type is suitable where the resource owner has the highest trust level with the client.

The resource owner provides its credentials to the client which is used by the client to obtain an access token from the authorization server. The client must authenticate itself with the authorization server.

So resource owner’s credentials are used a single time to obtain a long-lived access token or refresh token. There is no need of storing the resource owner’s credentials for future use.

In this type, Client credentials are used as an authorization grant. In the previous type, the resource owner’s credentials are used as an authorization grant. This is useful when the protected resources are under the control of the client or the client is also the resource owner.

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

Uncategorized

Post navigation

Previous Post: How To Launch Chrome Browser In Selenium WebDriver – Java
Next Post: Postman Tutorial Part 40 – Collection Variables in Postman

Related Posts

REST Assured Tutorial 20 – How to Send a JSON/XML File as Payload to Request Uncategorized
How To Remove Duplicate Values From List Using Java Stream API? Uncategorized
Selenium Topics – Page 15 – Make Selenium Easy Uncategorized
Installation of JAVA, Eclipse and Selenium – Make Selenium Easy Uncategorized
TestNG Tutorials 40: Groups of Groups or MetaGroups in TestNG | Make Selenium Easy Uncategorized
tests in postman 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