Explain OAuth (Open Authorization)
Last Updated :
04 Oct, 2021
OAuth is an open authorization standard (not authentication, OpenID can be used for authentication). As a result, OAuth is not an authentication protocol. A delegation protocol, on the other hand, is used to communicate permission choices between web-enabled apps and APIs. It is extensively used to get user information approved by the user for websites, online services, and applications. So the user grants the services access to information, but you do not need to provide those services with your user credentials, such as passwords.
Applications that enable third-party service login typically request the user to authenticate themselves by providing options such as "Login With Facebook" or "Login With Google", etc., allowing the user to use their credentials to login with the third-party service. As a result, the service provides the access token to the requesting application, proving the identity of the person seeking access. The token is then used to make requests to the end-desired user's resources.

Working: Assume a person has previously registered for one website or service (OAuth only works using HTTPS). The user then begins a feature/transaction that requires access to a different site or service. The following occurs (very simplified):
- The first website uses OAuth to connect to the second website on behalf of the user, revealing the user's confirmed identity.
- The second site creates a one-time token and a one-time secret that are specific to the transaction and parties involved.
- The first site sends this token and secret to the client software of the beginning user.
- The request token and secret are presented to the authorization provider by the client's program (which may or may not be the second site).
- If the client has not previously authenticated with the authorization provider, he or she may be prompted to do so. Following authentication, the customer is prompted to authorize the authorization transaction with the second website.
- The access token is sent by the first website to the second website as proof of authentication on behalf of the user.
- The second website allows the first website to visit its site on the user's behalf.
OAuth is not the first authentication/authorization mechanism to act in this manner on the end-behalf. User's In reality, several authentication systems, most notably Kerberos, operate in a similar manner. What makes OAuth unique is its ability to function across the web and its widespread usage. It was successful in terms of adoption rates when earlier initiatives had failed (for various reasons).
There are three components in OAuth mechanism:
- OAuth Provider: This is the OAuth provider like Google, Facebook, etc.
- OAuth Client: This is the webpage where we share or authenticate the use of our information. For example, GeeksforGeeks.com
- Owner: The user whose login validates information sharing.
Note: For “Login/Sign Up with Google” on a web app, OAuth may be enabled using the Google Console.
- OAuth 2.0 Client ID may be obtained via the Google API Console.
- Then, to use the API, obtain an access token from the Google Authorization Server.
- Send the request to an API along with the access token.
- If you need more time, get a Refresh token.
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Software Development Life Cycle (SDLC) Software development life cycle (SDLC) is a structured process that is used to design, develop, and test good-quality software. SDLC, or software development life cycle, is a methodology that defines the entire procedure of software development step-by-step. The goal of the SDLC life cycle model is
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Steady State Response In this article, we are going to discuss the steady-state response. We will see what is steady state response in Time domain analysis. We will then discuss some of the standard test signals used in finding the response of a response. We also discuss the first-order response for different signals. We
9 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
Waterfall Model - Software Engineering The Waterfall Model is a Traditional Software Development Methodology. It was first introduced by Winston W. Royce in 1970. It is a linear and sequential approach to software development that consists of several phases. This classical waterfall model is simple and idealistic. It is important because
13 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 min read