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
73
Academic Software Development Collaboration Tools
brandon_beacher
3
180
Other Decks in Programming
See All in Programming
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
380
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
480
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
1.9k
Dive into Triton Internals
appleparan
0
350
Software Architecture
hschwentner
6
2.4k
data-viz-talk-cz-2025
lcolladotor
0
100
Pythonに漸進的に型をつける
nealle
1
140
マンガアプリViewerの大画面対応を考える
kk__777
0
430
Claude Agent SDK を使ってみよう
hyshu
0
1.4k
iOSでSVG画像を扱う
kishikawakatsumi
0
180
Vue 3.6 時代のリアクティビティ最前線 〜Vapor/alien-signals の実践とパフォーマンス最適化〜
hiranuma
2
330
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
250
Featured
See All Featured
A better future with KSS
kneath
239
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Why Our Code Smells
bkeepers
PRO
340
57k
A designer walks into a library…
pauljervisheath
209
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Visualization
eitanlees
150
16k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
The Cult of Friendly URLs
andyhume
79
6.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.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