News for hackers. Stuff that matters.
Re:Loginsrv: JWT login microservice with back ends like OAut... by egberts1 on Saturday May 23, 2020 @05:33PM (#23286684)
Mmmm, it’s uses JWT. That went out the window, for me.

My checklist: https://egbert.net/blog/articles/authentication-for-api.html

Re:Loginsrv: JWT login microservice with back ends like OAut... by eganist on Saturday May 23, 2020 @06:22PM (#23287088)
egberts1, can you please share your reasons for "DO NOT use JWT"? The citation on your blog only links to the wikipedia page https://en.wikipedia.org/wiki/JSON_Web_Token rather than a resource describing any issues with JWTs specifically.

...I also have to wonder why no CORS. When properly managed (e.g. static-whitelisted allowed origins + allowed credentials from/to dedicated domains) and combined with other best practices around your web SSO framework of choice, it's fine for contexts such as SSO with no back-end sync.

Re:Loginsrv: JWT login microservice with back ends like OAut... by michaelchisari on Saturday May 23, 2020 @08:59PM (#23288142)
I can't speak for egberts1, but Thomas Ptacek(@tptacek) has written a lot on why JWTs should be avoided.

Here's an HN search for his comments on JWTs:

https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

Here is one of his comments about JWT:

In cryptography, we have a concept of "misuse resistance".

https://news.ycombinator.com/item?id=14292223)

Re:Loginsrv: JWT login microservice with back ends like OAut... by toomuchtodo on Saturday May 23, 2020 @09:29PM (#23288277)
The comment you link to is gold. Thank you.
Re:Loginsrv: JWT login microservice with back ends like OAut... by egberts1 on Sunday May 24, 2020 @08:29AM (#23291035)
CORS isn’t bad practice. It is supported on all major browsers, and more and more APIs are supporting it. In fact, if you have a public resource that is not behind a firewall, it is safe to put the Access-Control-Allow-Origin: * header on the resource.

But there is some confusion over the role of CORS on a server. CORS should only dictate the cross-origin policy for a particular resource. In other words, the CORS headers are only meant to indicate whether requests from different origins are allowed. I think the confusion comes in because servers sometimes use CORS to dictate security policy as well. CORS is not security. If servers have resources that need to be protected from certain users, it is not safe to rely solely on the Origin header to enforce this. Your server needs some other mechanism for security (such as OAuth2 and CSRF protection).

In short, CORS is not about security of the server. And it is not even considered a whole security for end-users but about the preventing your server from misusing your clients’ “WebOS” resources by your 3rd party affiliates (advertisers), and pretty much nothing else.

Re:Loginsrv: JWT login microservice with back ends like OAut... by jugg1es on Saturday May 23, 2020 @06:26PM (#23287124)
yea there is zero justification in your blog - just references to pages describing the technology. I would be interested to know what the rational is.
Re:Loginsrv: JWT login microservice with back ends like OAut... by egberts1 on Sunday May 24, 2020 @08:17AM (#23290971)
Yes. That is true what you’ve said. Sometime, with waves of web pages, coupled with the analytical thoughts of weakness in each leg of a protocol, I should have explicitly noted them. In this case, I was in a hurry to put it down. Better to document what I’ve noticed and find justification later. My bad.
Re:Loginsrv: JWT login microservice with back ends like OAut... by egberts1 on Sunday May 24, 2020 @08:35AM (#23291070)
So, I’ve added more on CORS in earlier thread under this GP.
Re:Loginsrv: JWT login microservice with back ends like OAut... by jugg1es on Sunday May 24, 2020 @07:06PM (#23295720)
your rationale leaves something to be desired. I don't know if its really valid to consider something a dangerous tech just because it can be misused. Your computer can be very dangerous if misused - such as if you drop it out of a window on someone's head - that doesn't mean you shouldn't use a computer :)
Re:Loginsrv: JWT login microservice with back ends like OAut... by egberts1 on Monday May 25, 2020 @03:14PM (#23303945)
As one who develops IDS/IPS for 23 years, it isn’t a “dangerous” issue, per se. It’s a “muddle” issue that runs contravenous to that “be liberal in what you receive, and conservative in what you send.” Like “exec” is for JavaScript.