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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
77
Academic Software Development Collaboration Tools
brandon_beacher
3
180
Other Decks in Programming
See All in Programming
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
140
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
100
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
Oxlint JS plugins
kazupon
1
990
CSC307 Lecture 07
javiergs
PRO
1
560
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
530
4 Signs Your Business is Dying
shpigford
187
22k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
920
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
830
[SF Ruby Conf 2025] Rails X
palkan
1
760
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
52
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Context Engineering - Making Every Token Count
addyosmani
9
660
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