Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Gems You Might Not Need - Authentication and Au...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Brandon Beacher
March 30, 2012
Programming
5
380
Gems You Might Not Need - Authentication and Authorization
Brandon Beacher
March 30, 2012
Tweet
Share
More Decks by Brandon Beacher
See All by Brandon Beacher
Ruby for Recruiters
brandon_beacher
1
78
Academic Software Development Collaboration Tools
brandon_beacher
3
180
Other Decks in Programming
See All in Programming
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
450
Docコメントで始める簡単ガードレール
keisukeikeda
1
100
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
460
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
Windows on Ryzen and I
seosoft
0
200
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
350
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
2
140
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
240
CSC307 Lecture 13
javiergs
PRO
0
310
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
380
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
240
Utilizing Notion as your number one productivity tool
mfonobong
4
250
How to Think Like a Performance Engineer
csswizardry
28
2.5k
How to build a perfect <img>
jonoalderson
1
5.2k
First, design no harm
axbom
PRO
2
1.1k
Raft: Consensus for Rubyists
vanstee
141
7.3k
Bash Introduction
62gerente
615
210k
The Pragmatic Product Professional
lauravandoore
37
7.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Prompt Engineering for Job Search
mfonobong
0
180
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Transcript
Gems You Might Not Need Authentication and Authorization
Authentication Who are you? Authorization Are you allowed to do
that?
Do I need an authentication gem? Maybe not...
has_secure_password • Built in to newer versions of Rails •
Adds methods to set and authenticate against a BCrypt password. • This mechanism requires you to have a password_digest attribute. https://gist.github.com/2252946
Invitations • Add an invitation_token string attribute to your model
• Generate the token with ActiveSupport:: SecureRandom.hex https://gist.github.com/2253047
Do I need an authorization gem? Maybe not...
Before filters • Methods with redirects https://gist.github.com/2253206
Before filters - a step further • Stay flexible to
meet needs https://gist.github.com/3f28fd45a9755dfafd72
The Forbid pattern • When you need to get more
granular than before filters • class ForbiddenError < StandardError • rescue_from ForbiddenError https://gist.github.com/2253303
The Forbid pattern - a step further • Stay flexible
to meet business needs https://gist.github.com/2253352
The End • Simple • Flexible • Easy to understand