Lurker News
I am currently starting work on a new app/website. Currently planning to have 1 BE API set to start, probably graphql (which will be user data/information and need to check with the auth server about being protected). I will also have many client apps (web, mobile, potential partners) that will need to make queries to that BE. Do you usually roll your own authentication or use something like auth0/fusionauth/gluu/etc? This product is going to need to be secure as it will be in the healthcare space (so think oidc).

Comments (236) 55 threads

Earlier comments
blhack3 replies#
Roll my own. Passwords are stored as bcrypt hashes. Just use plain old cookies to store session IDs.
basejumping1 reply#
No, everyone should use auth0, okta, cognito
bpicolo#
Auth isn't rocket science - I'd encourage people to recommend well-guided DIY here for newer developers in a lot of cases, because foundational tech learning experiences are critical to growing as a developer.

There's value to many in SaaS offerings, but any decently-sized programming ecosystem has a crap ton of auth offerings. e.g. Devise [0], Dotnet Identity [1], Django Auth [2]. Authorization is the fiddly/annoying part. For authentication, a reasonably motivated developer can expect to have workable, secure password authentication going in a couple hours, as long as they don't try to invent their own encryption scheme.
[0]: https://github.com/plataformatec/devise [1]: https://docs.microsoft.com/en-us/aspnet/core/security/authen... [2]: https://docs.djangoproject.com/en/2.1/topics/auth/

tnr23#
Exactly! +1

Simplicity is also Security

equasar2 replies#
What about localstorage for storing a token instead of a cookie?
tnr23#
what about caring about things that matter?
blhack#
What benefit would that have over a cookie? (Honest question)
throwawaypls#
Devise, if you’re building a Rails app.
chirau3 replies#
Why do all API development tutorials always say "Never roll out your own custom auth"? I always found it weird
ams6110#
If you're not experienced at it, it's easy to make exploitable mistakes. Most of those have been identified, and avoided, in standard auth implementations.
throwawaymath#
They say it because as a development exercise it is both seductively attractive and very dangerous. Furthermore, almost no one's authentication problems are unique or unsolved.

There is approximately never a good reason for a team to roll their own authentication solution from the base primitives unless that's both their core competency and their product differentiation. It offers virtually no upside for virtually certain downside.

caseysoftware1 reply#
What they said..

- Your authentication problems are not unique to you;
- The effort of implementing standards (whether it's front end like OAuth, OIDC, or SAML or back end like hashing) is a pain in the butt and easy to make bad choices;
- If your project is successful or as your requirements change over time, now you have to figure out how to add MFA, password resets, internationalization, address security audits, etc, etc.
Doing it yourself means you have 100% responsibility for everything when that is probably not your main skillset or really what you want to spend your time doing anyway.
Disclosure: I work for one of the companies mentioned in this thread.

chirau1 reply#
Hey man, funny thing, I just completed your 3 courses on Lynda.com on the REST API learning path yesterday. I did the Design one, the Validation and Authentication one and the OAuth/OpenID one.

Good stuff.
Also, I have a question for you, is there a good place to reach you?

caseysoftware#
Thanks and great to hear. My email is in my profile. Feel free to drop me a note.
victorNicollet1 reply#
We use SAML set up for our customers' identity providers (most of the time, Office365 Azure AD or Google Suite), from a NuGet package.

From there, it's a bearer token encoded in JWT format for ease of debugging. From another NuGet.
We also support username and public key authentication for our SFTP server.
We do support username and password if necessary.

baq1 reply#
and what do you use for authorization?
victorNicollet#
Custom rules on top of ASP.NET middleware.

Load more comments