5 ms·
Any Reason why Rails still does not include an any decent Auth by default? Edit: I remembering keep asking this question but obviously no answer was satisfacto
by ksec 8y ago
Any Reason why Rails still does not include an any decent Auth by default?
Edit: I remembering keep asking this question but obviously no answer was satisfactory enough that stick to my brain.
- hit8run 8y agoI think the defacto standard is devise but they want you to be flexible enough to roll your own or whatever serves you. I would like to have it built in though.
- petepete 8y agoThis sounds about right. And if you want something in between without rolling your own, Sorcery is excellent. https://github.com/Sorcery/sorcery https://github.com/Sorcery/sorcery
- jjgreen 8y agoLooks interesting, thanks
- ken 8y agoI'm not familiar with recent versions of Rails or its authentication situation, but whenever I hear this said about some mandatory functionality of a system, it sounds to me exactly like "We haven't yet figured out how to do ___ well". It reminds me of the old days when I'd get a library which would say "We want to be flexible, so just pass in any memory allocation function here!", or Linux distros that said "We want to be flexible, so just write any boot script here!" Then a year later, some competitor ships with a default, and everybody switches over to that because it's obviously better (and you can always customize it if you need to). Especially so with Rails, whose entire existence seems to be picking good-enough defaults.
- mplewis 8y agoThere are many ways to do auth. Some Rails auth gems are more prescriptive than others. All of them involve large tradeoffs in various directions. It would be weird to bless just one of them as the "right" way to do auth in Rails, imo.
- aaronbrethorst 8y agohas_secure_password is built in, and works as long as you include the bcrypt gem in your Gemfile. I've never found Devise or any other 'off the shelf' solution to be satisfying for me because authentication seems to vary just enough between projects to make it easier to use has_secure_password and rewrite auth from scratch. Personally, I think it would be cool if someone built an user account/authentication experience as a generator (along the lines of Rails scaffolds), so that you could see all of the generated code and modify it without having to get elbow-deep into the bowels of what I find to be an overly-abstract gem.
- ravenstine 8y agoThat's been my experience with Devise and similar libraries for other frameworks and languages. If it fulfills all needs for a project, that's great, but I tend to find that it's simpler just to build authentication around authentication "primitives" like has_secure_password. The thing I do like about Devise is that it has views for everything including password reset out of the box. The abstractions it provides end up being more of a headache than they are worth. To be honest, I'd rather see more gems for these sorts of purposes that are just a collection of off-the-shelf views that can be easily tied in to one's authentication solution of choice. By installing Devise, you bring all of the extra non-view baggage it comes with into the application's memory space even if you don't use it. Yuck. (no offense!) Actually, I just reread your comment and I think your scaffold/generator approach is also a nice way to go. It's just too bad that there hasn't been as much development effort towards these sorts of things recently in the Ruby community. I'd build it, but have gotten away from Ruby because the community is obsessed with applying object-orientation to every problem, over-abstracting, metaprogramming, etc.
- owens99 8y agoHave you tried Devise? It’s not default but it’s one of the best Auth tools I’ve seen in any stack. I love it and use it in tons of apps.
- brightball 8y agoBecause every application doesn't need it and it's virtually effortless to add Devise, which is the defacto standard at this point.
- intelliderp 8y agoAuthentication is currently a tire fire all across the web, regardless of framework. It's not unheard of for login issues to consume the efforts of a full-time senior dev on a team. Not including RESTful APIs, the "best practice" for auth has shifted rapidly in the past 10 years from OAuth2 to OpenID to JWT... these frameworks take considerable effort to learn, add to that the fact that the major identity providers (FB, Google, etc.) are undergoing major legal challenges across the world. It's becoming the case that only large teams can actually put together a login page. In this environment, I think hesitancy is warranted.
- Kalium 8y ago> Any Reason why Rails still does not include an any decent Auth by default? If memory serves, Rails has quite good authentication built in by default. If that's not what you meant, could you clarify?