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
5
370
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
70
Academic Software Development Collaboration Tools
brandon_beacher
3
180
Other Decks in Programming
See All in Programming
GoのGenericsによるslice操作との付き合い方
syumai
2
660
社内での開発コミュニティ活動とモジュラーモノリス標準化事例のご紹介/xPalette and Introduction of Modular monolith standardization
m4maruyama
1
130
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
41
27k
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
190
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.5k
業務自動化をJavaとSeleniumとAWS Lambdaで実現した方法
greenflagproject
1
120
関数型まつりレポート for JuliaTokai #22
antimon2
0
130
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
380
複数アプリケーションを育てていくための共通化戦略
irof
10
4k
カクヨムAndroidアプリのリブート
numeroanddev
0
430
C++20 射影変換
faithandbrave
0
500
Featured
See All Featured
Music & Morning Musume
bryan
46
6.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
4 Signs Your Business is Dying
shpigford
184
22k
Making Projects Easy
brettharned
116
6.2k
Six Lessons from altMBA
skipperchong
28
3.8k
Building Adaptive Systems
keathley
43
2.6k
Done Done
chrislema
184
16k
Documentation Writing (for coders)
carmenintech
71
4.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
How to Ace a Technical Interview
jacobian
277
23k
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