# What the Heck is OAuth?

**URL:** <https://devforum.okta.com/t/what-the-heck-is-oauth/16754>\
**Category:** Developer Blog Comments\
**Created:** [November 21, 2017, 5:17pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754 "2017-11-21T17:17:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [November 21, 2017, 5:17pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/1 "2017-11-21T17:17:48Z")

</div>

[What the Heck is OAuth?](https://developer.okta.com/blog/2017/06/21/what-the-heck-is-oauth)

OAuth 2.0 is a standard that apps can use to provide client applications with secure delegated access. OAuth works over HTTPS and authorizes devices, APIs, servers, and applications with access tokens rather than credentials. OIDC adds a signed ID token and a UserInfo endpoint.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 11, 2017, 12:33pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/2 "2017-12-11T12:33:12Z")

</div>

**romlly**

One of the most complete blog post about OAuth2, nice job 🙂

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [March 29, 2018, 12:16pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/3 "2018-03-29T12:16:52Z")

</div>

**Tom**

Amazing article!   
Great job!

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [May 23, 2018, 9:44am UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/4 "2018-05-23T09:44:38Z")

</div>

**Aurélien Sylvan**

The best article I’ve ever read about OAuth. Thank you !

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 11, 2018, 7:02pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/5 "2018-08-11T19:02:30Z")

</div>

**TecbrÎc B’zile Tankeu**

a real explanation of the thing.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 25, 2018, 12:39pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/6 "2018-10-25T12:39:46Z")

</div>

**Dennis Allard**

Not very well written. Uses too much terminology before defining it. Perhaps OAuth2 is as complicated as this article makes it seem. Bummer.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 25, 2018, 4:26pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/7 "2018-10-25T16:26:10Z")

</div>

**Matt Raible**

I’m sorry you don’t like it Dennis. Perhaps you’ll enjoy a presentation I did on the same topic a couple weeks ago. I [recorded and uploaded it to YouTube](https://youtu.be/GCRO1l4ik0E "https://youtu.be/GCRO1l4ik0E"). If that’s still not helpful, you should checkout our my colleague, Nate Barbettini’s [OAuth 2.0 and OpenID Connect (in plain English)](https://youtu.be/996OiexHze0 "https://youtu.be/996OiexHze0"). Most people love it.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 12, 2018, 1:08pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/8 "2018-12-12T13:08:26Z")

</div>

**Yash Ganthe**

In the example, the Authorization Server (Google) is presenting a screen letting the user allow the application (SomeApp) access the resource (Gmail). Here Google and Gmail are from the same company. What is auth server is Okta? Is that a valid scenario? Can Okta present a screen asking for permission and the resource server Gmail give access based on the token given by Okta?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 12, 2018, 1:18pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/9 "2018-12-12T13:18:08Z")

</div>

**Yash Ganthe**

The article says, once the token is received the resource server can serve data:  
 curl -H “Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA” \<br\> [https://www.googleapis.com/…](https://www.googleapis.com/gmail/v1/users/1444587525/messages "https://www.googleapis.com/gmail/v1/users/1444587525/messages")

What does the API server need to do to respect the request that carries the token?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 12, 2018, 4:19pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/10 "2018-12-12T16:19:28Z")

</div>

**Matt Raible**

The auth server in Okta is in your developer account under **API** \> **Authorization Servers**. A custom one is created for you named “default”, but you can create additional ones easily. As far as using Okta and Gmail together, yes it’s possible. If I go to Google Docs, or Gmail, and use my Okta email, it redirects me to Okta to login.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 12, 2018, 4:20pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/11 "2018-12-12T16:20:54Z")

</div>

**Matt Raible**

The API server needs to be configured as a resource server that looks for an access token and denies access if one is not present. If you’re working in a certain language or framework, let me know and I can try to point you to samples and tutorials.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 13, 2018, 1:58am UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/12 "2018-12-13T01:58:04Z")

</div>

**Yash Ganthe**

Working in Java and NodeJS on the server side

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 13, 2018, 5:40am UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/13 "2018-12-13T05:40:02Z")

</div>

**Yash Ganthe**

Can the authentication be done by one server and authorization by another? Do the authentication server and authorization server need to communicate?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 13, 2018, 7:37pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/14 "2018-12-13T19:37:26Z")

</div>

**Matt Raible**

Authentication is not part of the OAuth 2.0 specification. The authorization server is something you set up at your IdP (e.g., Google, Facebook, or Okta). When you’re redirected to the authorization server, there’s likely an authentication process that happens, but how that happens is not defined as part of OAuth 2.0. To answer your question, I believe they’re on the same server most of the time.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 13, 2018, 7:41pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/15 "2018-12-13T19:41:55Z")

</div>

**Matt Raible**

For Java and Spring Boot, there’s an [Okta Spring Boot Starter](https://github.com/okta/okta-spring-boot "https://github.com/okta/okta-spring-boot") that you can use for your resource server. We [just published a post](https://developer.okta.com/blog/2018/12/13/build-basic-app-spring-boot-jpa "https://developer.okta.com/blog/2018/12/13/build-basic-app-spring-boot-jpa") that shows how you can use this to set up a resource server. If you’re not using Spring Boot, take a look at [Build a Java REST API with Java EE and OIDC](https://developer.okta.com/blog/2018/09/12/secure-java-ee-rest-api "https://developer.okta.com/blog/2018/09/12/secure-java-ee-rest-api"). This shows you how to use a JWT Verifier filter, among other techniques. For Node, see our [Node.js/Express.js Quickstart](https://developer.okta.com/quickstart/#/okta-sign-in-page/nodejs/express "https://developer.okta.com/quickstart/#/okta-sign-in-page/nodejs/express").

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 14, 2018, 2:18pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/16 "2018-12-14T14:18:56Z")

</div>

**Yash Ganthe**

I have created a diagram based on the blog post. [https://uploads.disquscdn.c…](https://uploads.disquscdn.com/images/e9a153ef9b187a3a8965ccab4d5740cbdbdc21c8052e988476fb48914923a270.jpg "https://uploads.disquscdn.com/images/e9a153ef9b187a3a8965ccab4d5740cbdbdc21c8052e988476fb48914923a270.jpg")

Please answer the questions marked in red. Thanks.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 21, 2018, 5:38pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/17 "2018-12-21T17:38:55Z")

</div>

**Micah**

1) Why is there no client secret in this request?

The browser is making the request directly to the Authorization Server. It’s not safe to store a client secret in a browser app. Per the specification: [https://tools.ietf.org/html…](https://tools.ietf.org/html/rfc6749#section-4.1.1 "https://tools.ietf.org/html/rfc6749#section-4.1.1"), only response\_type and and client\_id are required

2) How does the Auth Server know the user is authenticated

The step that’s pictured in the diagram above this represents “consent” ("WebApp wants to access XYZ ABC …). Consent occurs AFTER authentication. In the normal flow (as you can observe on Google, Facebook, Okta, etc.) is that you must authenticate first and then you’d see the consent dialog.

3) How does the Resource Server validate the access token with the Auth Server

Two options here. The OAuth specification does not dictate the format for tokens and as such, they are considered “opaque”. In this case, the Resource Server must make an introspect request of the Authorization Server to get back the information (like scopes and timeout) that the token represents. Introspect request and response is covered here: [https://tools.ietf.org/html…](https://tools.ietf.org/html/rfc7662#section-2.1 "https://tools.ietf.org/html/rfc7662#section-2.1"). However, the second approach is now more prevalent and is used by Okta (and others). In this case, the access token is a JWT that has a signature computed using the RS-256 algorithm and a private key used by Okta. The resource server can use the corresponding public key (which it can obtain using the metadata from the well known endpoint, like: [https://micah.okta.com/.wel…](https://micah.okta.com/.well-known/openid-configuration) "https://micah.okta.com/.well-known/openid-configuration)") to validate the access token WITHOUT having to make the introspect request of the Authorization Server. This saves a lot of network traffic.

4) Does the Resource Server need to validate the access token every time

Yes. But, HOW the validation is done is dependent on the formatting of the token. If you’re using Okta, then, per the second part of #3 above, you would just validate the cryptographic signature using a library, like JJWT ([https://github.com/jwtk/jjwt)](https://github.com/jwtk/jjwt) "https://github.com/jwtk/jjwt)"). If you’re using a provider that does not use JWT for access tokens, then you would need to make an introspect request.

Here’s a diagram to match (and update) yours:

[https://uploads.disquscdn.c…](https://uploads.disquscdn.com/images/8e515c2c3d7ac0200ce95c0a4fc35336194e6e40df358964b3837701d75e5a99.png "https://uploads.disquscdn.com/images/8e515c2c3d7ac0200ce95c0a4fc35336194e6e40df358964b3837701d75e5a99.png")

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [December 26, 2018, 2:03pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/18 "2018-12-26T14:03:33Z")

</div>

**Yash Ganthe**

#2 \> Who will be verifying that the Authentication has indeed happened and how? What happens if a browser tries to authorize without having authenticated?

Thanks a lot for the rest of the answers.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 7, 2019, 10:53pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/19 "2019-01-07T22:53:41Z")

</div>

**Micah**

In the specific case, Okta handles the authentication. It’s (securely) stored the user credentials and performs the authentication prior to showing the consent form. But, it’s the same for other providers that support these types of flows. If you’re using Facebook, then Facebook does the authentication and presents the consent form.

If you’re not authenticated, you would see the hosted login form (both in the case of Okta and Facebook).

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 13, 2020, 7:24pm UTC](https://devforum.okta.com/t/what-the-heck-is-oauth/16754/20 "2020-01-13T19:24:48Z")

</div>

**Antony Baasandorj**

Can someone explain this:  
Article said: **Because these tokens can be short lived and scale out, they can’t be revoked**.  
But there is **RFC 7009: token revocation** ([https://oauth.net/2/token-r…](https://oauth.net/2/token-revocation) "https://oauth.net/2/token-revocation)"). Is the article talks about different token?

[Next page](https://devforum.okta.com/t/what-the-heck-is-oauth/16754.md?page=2)
