News for hackers. Stuff that matters.
Re:Show HN: OAuth microservice for FB, Twitter, etc. by saganus on Tuesday July 04, 2017 @10:44AM (#14696132)
So what's exactly the use case for this? I'm not entirely sure.

Let's say I deploy it. Users of whatever service I provide use this to login to Google, Twitter, etc, then what? do I need to also implement something on the servers I'm protecting behind a login? I.e. some "verification" method that checks whether the client's JWT tokens are valid so I can grant them access?

Re:Show HN: OAuth microservice for FB, Twitter, etc. by fitz2001 on Tuesday July 04, 2017 @11:02AM (#14696229)
It's helpful if you want your website/webapp to support login with X (Google, Facebook, etc). Your services on the same domain can than use these credentials and eventually use the respective API's with the per-user key.

All you need to do is: a) get key/secret for the respective service b) deploy this microservice with the respective env variables

Re:Show HN: OAuth microservice for FB, Twitter, etc. by usea on Tuesday July 04, 2017 @12:18PM (#14696697)
This kind of explanation would be really useful on the website. Right now it has nothing to describe what it is/does.
Re:Show HN: OAuth microservice for FB, Twitter, etc. by aisofteng on Tuesday July 04, 2017 @09:03PM (#14699332)
The explanation you replied to didn't say anything I didn't find obvious from the tag line.
Re:Show HN: OAuth microservice for FB, Twitter, etc. by saganus on Tuesday July 04, 2017 @11:30AM (#14696420)
Aha. So it protects the service via protecting the domain itself, right?

I'll have to give it a try.

Re:Show HN: OAuth microservice for FB, Twitter, etc. by nielsole on Tuesday July 04, 2017 @11:06AM (#14696264)
"On successful login two cookies will be created:

    jwt - A "JSON Web Token" (JWT) containing profile information and the respective access tokens (Twitter/etc). http-only!
    profile - A JSON string which containing non-sensitive information (accessible from browser JS):
        username - string / mandatory, the account specific user alias (e.g. Twitter name)  - photo - string / optional, the account specific user image link
        name - string / optional, the "real" name
" This looks like just enough rope to hang oneself. If you check only the profile variable it could easily be set by the user herself. So I guess you need to check the jwt. I guess it makes more sense if this would be run as reverse proxy so the cookies can't be tampered with.
Re:Show HN: OAuth microservice for FB, Twitter, etc. by transitorykris on Tuesday July 04, 2017 @12:28PM (#14696757)
The JWT is signed (see LW_JWT_SECRET env variable), you'll want to check the signature before trusting the rest of the contents.
Re:Show HN: OAuth microservice for FB, Twitter, etc. by _ao789 on Tuesday July 04, 2017 @01:13PM (#14697052)
Pet gripe: don't say "JWT tokens", it's just "JWT". That's what the T stands for..
Re:Show HN: OAuth microservice for FB, Twitter, etc. by saganus on Tuesday July 04, 2017 @05:31PM (#14698424)
True. It's a bad habit I guess.