News for hackers. Stuff that matters.
Re:Using OAuth to add authentication to a React app by iso1210 on Friday November 12, 2021 @08:27AM (#29199044)
I just add oauth in my proxy using libapache2-mod-auth-openidc, and set a HTTP header to pass user info to the server (which only accepts connections from the proxy IPs)

You can write your application in react, php, perl, bash, c, or just manually answer to http calls for all I care.

Re:Using OAuth to add authentication to a React app by crucialfelix on Friday November 12, 2021 @10:13AM (#29199995)
I'm considering something similar for protecting some simple ML serving API endpoints. Just put a proxy in between.

Something like

https://github.com/gogatekeeper/gatekeeper/blob/master/docs/...

It's no problem to set up Django, but I don't want to have to separately protect all public endpoints.

Re:Using OAuth to add authentication to a React app by combinatoroid on Thursday November 18, 2021 @11:47AM (#29267501)
do you have different backend servers for those endpoints?
Re:Using OAuth to add authentication to a React app by mooreds on Friday November 12, 2021 @09:41AM (#29199661)
Love the gateway pattern. It's something I just spent some time investigating for a client and it is really elegant.

How do you store the tokens that the OAuth server generates on successful authentication?

Re:Using OAuth to add authentication to a React app by iso1210 on Friday November 12, 2021 @03:21PM (#29204086)
I leave that the the module, I believe it uses client cookies by default, but I use a persistent server cache on disk (the session tokens are stored encrypted)

https://github.com/zmartzone/mod_auth_openidc/wiki/Session-m...

Re:Using OAuth to add authentication to a React app by chasd00 on Friday November 12, 2021 @09:22AM (#29199493)
that's... very interesting, I never even thought about handling auth in this way (make a proxy do it). Granted, i haven't set up auth in an application in probably a decade so this may be SOP.