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
85
Academic Software Development Collaboration Tools
brandon_beacher
3
190
Other Decks in Programming
See All in Programming
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.8k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
570
リアルな遅延を測る仕様
kota_yata
1
130
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
130
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
130
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
600
AIエージェント時代のコードレビューを設計する
nogu66
5
1.2k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
430
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
FDEとは、何者なのか?
masapyon1212
0
110
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
500
XHTMLが残したもの
yosuke_furukawa
PRO
1
320
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
710
The Pragmatic Product Professional
lauravandoore
37
7.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
440
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
570
Optimising Largest Contentful Paint
csswizardry
37
3.9k
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