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
Brandon Beacher
March 30, 2012
Programming
380
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Gems You Might Not Need - Authentication and Authorization
Brandon Beacher
March 30, 2012
More Decks by Brandon Beacher
See All by Brandon Beacher
Ruby for Recruiters
brandon_beacher
1
84
Academic Software Development Collaboration Tools
brandon_beacher
3
190
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
dRuby over BLE
makicamel
2
380
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
150
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
New "Type" system on PicoRuby
pocke
1
970
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
410
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
710
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
360
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
200
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
9.1k
WCS-LA-2024
lcolladotor
0
650
Scaling GitHub
holman
464
140k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
What's in a price? How to price your products and services
michaelherold
247
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Believing is Seeing
oripsolob
1
150
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
My Coaching Mixtape
mlcsv
0
150
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
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