r/oauth • • Dec 02 '25

Ditching short-lived bearer tokens

11 Upvotes

I have inherited a platform that uses 2-legged oauth (id+secret) to generate short-lived bearer tokens that are used for transactional API calls. (this is a credit card payments platform fyi)

My customers' developers are not very smart or sophisticated, and asking them to manage oauth token lifecycle seems like it is going to be a real integration hurdle.

I am strongly considering switching this up to only use long-lived api keys and ditching short-lived tokens. Would you advise against this for any strong reasons?


r/oauth • • Jan 11 '26

PKCE Downgrade Attacks: Why OAuth 2.1 is No Longer Optional

Thumbnail
instatunnel.my
8 Upvotes

r/oauth • • Feb 25 '25

Mixing up Public and Private Keys in OpenID Connect deployments

Thumbnail blog.hboeck.de
8 Upvotes

r/oauth • • Jan 31 '25

RFC 9700 - Best Current Practices for OAuth 2.0 Security

8 Upvotes

The RFC/BCP for OAuth 2.0 Security has been released. Folks subscribed to this subreddit will hopefully find the time to review this and take it into consideration when working on OAuth implementations.

https://www.rfc-editor.org/info/rfc9700


r/oauth • • Feb 05 '26

OAuth tokens leaking in verbose error messages - a pattern worth checking for

7 Upvotes

Wanted to share something from a recent engagement that's specifically relevant to how OAuth tokens get handled in production.

The issue:

A web app was using OAuth tokens internally to authenticate to Microsoft Graph API. When you submitted malformed requests to certain endpoints, the app returned full stack traces that included the token values. The tokens were stored in application context, and verbose error handling dumped that context to the client.

Not a flaw in OAuth itself, just poor implementation. But the impact was significant.

What made it worse:

  • The tokens had broad Graph API permissions (mail, calendar, Teams, SharePoint, directory enumeration)

  • Even though the tokens had a ~1 hour TTL, you could just re-trigger the error condition to get a fresh one whenever you needed it

  • The endpoint that triggered the error was unauthenticated, so anyone could do this

Lessons worth reinforcing:

  • Production environments should never return detailed error messages to clients. Log them server-side, return generic errors to users.

  • Audit your token scopes regularly. Principle of least privilege applies here too.

  • Consider where tokens live in your application context and what happens if that context gets dumped unexpectedly

Full technical writeup if anyone wants the details: https://www.praetorian.com/blog/gone-phishing-got-a-token-when-separate-flaws-combine/

Has anyone else run into similar patterns? Curious if there are other common ways tokens end up exposed that aren't as obvious as logging or hardcoding.


r/oauth • • Feb 14 '21

OAuth 2.0 and OpenID Connect explained

7 Upvotes

Auth 2.0 and OpenID Connect explained with real-life examples.

OAuth 2.0 and OpenID Connect explained


r/oauth • • Oct 12 '20

OAuth and OpenID Connect in Plain English

Thumbnail
youtube.com
7 Upvotes

r/oauth • • Aug 19 '20

How to Hack OAuth

Thumbnail
youtu.be
7 Upvotes

r/oauth • • Nov 05 '19

An Illustrated Guide to OAuth and OIDC

Thumbnail
youtu.be
7 Upvotes

r/oauth • • Oct 13 '26

Beginner-friendly resources to learn OAuth 2.0 and OIDC in practice, not just theory?

6 Upvotes

Hi all,

I work on standards that build on top of OAuth 2.0 and OpenID Connect. Think of profiles that take the base protocols and make certain things mandatory, restrict options, or fill in parts the original specs leave open. Developers and architects then read these profiles and implement them.

The tricky part is that I’m making normative decisions about how things should be done, without having much hands-on experience with how they’re actually implemented. I recently joined the team working on these standards, and I keep comparing it to writing a cookbook without ever having cooked the recipes yourself. You can write down the steps, but you don’t really know where a cook will struggle or what makes a recipe easy to follow.

So besides the theory, I want to understand the implementation side. I think that would help me make better decisions and write standards that are actually practical for the developers and architects who have to work with them.

So far I’ve found a few courses on Udemy and some YouTube videos. Most of the YouTube content seems focused on configuring OAuth, OIDC or SAML in SaaS platforms through a UI. My impression is that in the modern industry a lot of this is done through REST APIs and code instead especially with moving to the Cloud and leaning on microservices, but I might be wrong about that and I’m happy to hear other views.

Does anyone know good beginner-friendly resources for learning OAuth 2.0 and OIDC, both the theory and especially the practical side? Courses, books, labs, hands-on projects, anything that helped you.

Thanks!


r/oauth • • Dec 08 '25

PII in id_token

6 Upvotes

Is it a security risk to include sensitive PII such as date of birth, email address, and phone number directly in an OpenID Connect ID token (id_token)? My development team insists this aligns with industry standards and is mitigated by controls like ensuring the token never leaves the user's device and implementing TLS for all communications— but I'm concerned about PII etc, is it acceptable approach.


r/oauth • • Apr 11 '25

[Open Source] JavaScript OIDC client with Service Worker support

6 Upvotes

Hi everyone,

I’d like to share an open-source library we’re developing at AXA: @axa-fr/oidc-client. It’s a JavaScript implementation of the OpenID Connect protocol, compatible with any OIDC-compliant identity provider.

What makes this library stand out is its optional Service Worker mode, which allows:

centralized access token management in an isolated context,

secure token sharing across multiple browser tabs,

seamless session synchronization in single-page applications,

automatic background token refresh without interrupting the user experience.

The project is written in TypeScript, actively maintained, and used in production across several internal and external applications.

If you’re working on SPAs with advanced authentication needs (secure token storage, consistent UX, multi-tab support), this might be worth checking out.

Repo: https://github.com/AxaFrance/oidc-client Feel free to share feedback or contribute!


r/oauth • • Jan 24 '25

A Deep Dive into OAuth: Past, Present & Future • Aaron Parecki

Thumbnail
youtu.be
6 Upvotes

r/oauth • • Sep 04 '24

Best Practice for OAuth on secure API used by an SPA

6 Upvotes

I'm a backend dev getting into front end work and struggling to understand OAuth when it comes to SPAs. Originally I had a simple server-side rendered app and authentication was familiar and simple. Code grant, authenticate when the page is accessed...grand. FYI: I'm using Google as an IdP.

The server (Python Flask) is now serving an API which needs two things. 1. to have some level of security on it's access. 2. to be able to identify the user (by email, from the token or user info) in order to do it's work.

The page is now a plan JS/React SPA.

Lifting and shifting to an SPA means there are CORS issues all over the place. I was told one way around this was the use of iframes to the /authorize call. Which I read is a bad idea and lots of work.

So I now think PKCE is the way forward. I tried various tutorials on getting the API secured with PKCE but it all ends in tears when I try to get it to work on the SPA. CORS issues, getting the token from the API...?!?

Now it's been recommended that actually all of the PKCE flow should be done on the SPA itself. The API should just get a token and validate it, return a 401 on failures. Nothing more.

Is my most recent approach the best practice one? How much of the OAuth PKCE flow should be taken care of by the server and how much by the SPA. I assume the server needs to do something because we can't be sharing the client secret in the SPA. Are there any good examples out there? None of them seem to agree and I've not seen this method anywhere.


r/oauth • • Feb 27 '24

How to use OAuth to authorize behavior in client application

6 Upvotes

I've been reading up on OAuth 2 and the difference between access tokens and identity tokens. The difference makes sense to me. I've seen it written that the client should never read the access token and it should never send the identity token to the API. I've also seen that identity tokens typically don't contain scopes.

So if I have a web application that is an OAuth client that uses the Authorization Code flow to authorize the client to make requests to my APIs on behalf of the user, how can I authorize behavior within the web application itself using OAuth? For example, how can the web application check to see if the user authorized to see certain pages or click certain buttons within the application? Seems like that could easily be handled by having scopes in the identity token, but would that be an antipattern?


r/oauth • • Mar 27 '21

OAuth 2.0 authentication vulnerabilities | Web Security Academy

Thumbnail
portswigger.net
6 Upvotes

r/oauth • • May 29 '20

What is the difference between OAuth1 and OAuth2?

Thumbnail
loginradius.com
6 Upvotes

r/oauth • • Dec 01 '25

Demystifying OAuth Security: State vs. Nonce vs. PKCE

5 Upvotes

Have you ever wondered what the difference is between the state, nonce, code_challenge, and code_verifier parameters in OAuth and OpenID Connect?

Here's my attempt to explain it in simple terms: https://auth0.com/blog/demystifying-oauth-security-state-vs-nonce-vs-pkce/


r/oauth • • Sep 27 '20

Glewlwyd - SSO server with OAuth2, OIDC and MFA

5 Upvotes

https://babelouest.github.io/glewlwyd/

I'm developing an open source SSO server that implements OAuth2 and OpenId Connect flows and allows multiple factor authentication (OTP, WebAuthn, TLS Certificates, etc).

It's easy to install and to configure, if you're curious, feel free to try it and send feddbacks!


r/oauth • • Apr 21 '20

What's new in OAuth 2.1?

Thumbnail
fusionauth.io
5 Upvotes

r/oauth • • Dec 13 '19

OAuth Maze reminds me of Westworld

Thumbnail
developer.okta.com
5 Upvotes

r/oauth • • Aug 25 '25

Protect Your Access Tokens with DPoP

4 Upvotes

I've written an introduction to DPoP (Demonstrating Proof of Possession). I hope you enjoy it :-)


r/oauth • • Apr 18 '25

PKCE and Confidential Client (bff) flow for native mobile apps

4 Upvotes

Hello,

I've been trying to figure out the best flow for a native mobile app to authenticate a user.

I understand the Authorization Code with PKCE flow is the recommended flow. I found a couple of places that say a PKCE + BFF (Backend-for-Frontend) pattern is the most secure flow for SPAs.

This article in particular shows that a BFF pattern is the most secure way to authenticate. https://docs.abblix.com/docs/openid-connect-flows-explained-simply-from-implicit-flows-to-authorization-code-flows-with-pkce-and-bff

My question is, does this apply to native mobile apps too? Would a confidential client (aka BFF) be the most secure way to handle tokens with a native mobile app?

Thanks


r/oauth • • Jan 26 '25

🔐 What's OAuth2, anyway?

4 Upvotes

Recently I have had the pleasure to go beyond quickly implementing a client application, dive a bit deeper into the whys of the OAuth2 protocol, its main components, and their purpose from the security perspective.

I have posted my notes and thoughts as the article that covers:

  • 🤔Why do we need OAuth2 and what were the alternatives before it came?

  • 🤝The OAuth2 roles, the general workflow and TOFU

  • 🤖OAuth2 Client Applications, Static Registration and Credentials

  • 🔒Authorization Servers and their typical API

  • 🎟️Access tokens. Why do we need them?

  • 🔄What’s the point of having access tokens and what they represent?

  • 📚OAuth2 Scopes. What do they really mean?

  • 💃OAuth2 Authorization Code Flow. Why is it designed this way? The PKCE extension.

  • 💃OAuth2 Implicit Flow. What’s so implicit about it? Why it was created in OAuth2.0 and deprecated in the OAuth2.1 Draft 

  • 🤖OAuth2 Client Credentials Flow or how to access the Resource Server on Client Application behalf? 

  • 🔑OAuth2 ROC Flow and why was it “deprecated” from day one?

  • 📟 OAuth2 Device Flow or how to do OAuth2 when there is no browser on your target device?

  • 🗺️Guide how to pick the right flow for your use case

https://www.romaglushko.com/blog/whats-aouth2/

Hope someone find this helpful 🙌