Hacker News new | ask | show | jobs
by tip_of_the_hat 800 days ago
Hey HN, author here.

When I was first learning OAuth, I found that all the guides were text-heavy and lacked code. I personally learn better from code, so I created a code-first guide. Let me know if you have any feedback!

3 comments

It's a decent skeleton for a server side client. You might consider showing how a token refresh might work.

There is often a need for public client side implementations as well. Are you planning on making one there? It's mostly the same idea but you do the redirects yourself with CSRF and PKCE.

Yup, planning on expanding to add a PKCE and OIDC walkthroughs as well!
I really enjoyed the way you presented that, really helped me to focus while reading.
This looks great! I'll surely come back to it later.

How much of the process can be pushed to server side? (Sorry, I don't speak JS.)

Pretty much all of it! The JS in this walkthrough is all server-side. I tried to keep the JS itself simple so that someone unfamiliar with the language could have an easy time following the code.
It’s all server side. It’s written using express which is a web server framework built on top of nodejs