Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
85
Academic Software Development Collaboration Tools
brandon_beacher
3
190
Other Decks in Programming
See All in Programming
アクセシビリティから考える情報設計
high_g_engineer
0
430
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.4k
mrbgem 三角測量 開発
ogom
0
140
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
4
200
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
1
660
すこし踏み込む CancellationToken
htkym
2
1.5k
カツオ、ご期待ください
suneo3476
0
120
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
560
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
400
Java 27新機能 / Java 27 new features
kishida
2
180
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
9.2k
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
5.1M
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
A better future with KSS
kneath
240
18k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Navigating Team Friction
lara
192
16k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
250
The Limits of Empathy - UXLibs8
cassininazir
1
690
The Pragmatic Product Professional
lauravandoore
37
7.5k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
310
Optimising Largest Contentful Paint
csswizardry
37
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