Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google Authenticator with NodeJS
Search
Philipp Dunkel
March 14, 2014
Programming
0
270
Google Authenticator with NodeJS
Mini-Talk at the first Vienn-NodeJS-Meetup
Philipp Dunkel
March 14, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.4k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
150
認証・認可の基本を学ぼう前編
kouyuume
0
260
AIコーディングエージェント(Gemini)
kondai24
0
240
GISエンジニアから見たLINKSデータ
nokonoko1203
0
170
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
120
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
140
チームをチームにするEM
hitode909
0
350
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
認証・認可の基本を学ぼう後編
kouyuume
0
240
開発に寄りそう自動テストの実現
goyoki
2
1.2k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
400
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
110
The Invisible Side of Design
smashingmag
302
51k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
Un-Boring Meetings
codingconduct
0
160
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
The Limits of Empathy - UXLibs8
cassininazir
1
180
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
120
Chasing Engaging Ingredients in Design
codingconduct
0
74
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
73
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
Transcript
GOOGLE-AUTHENTICATOR WITH NODEJS PHILIPP DUNKEL PIPOBSCURE
PROTOCOL • T imebased • O ne • T ime
• P assword RFC 6238 - http://tools.ietf.org/html/rfc6238
PRO - CON/CAVEATS • Variable / Changing • Second Factor
• Standardised • Added Security • Shared Secret • Raw Secret Stored !
GOOGLE AUTHENTICATOR - IN THE WILD • Amazon Web Services
• Asia Nexgen • Atomic-Trade.com • App.net • Bitstamp • Bitcoin.de • Blockchain.info • BTC-e.com • CaVirtEx.com • Cex.io • CipherGraph Networks • Coinbase • Dashlane • DigitalOcean • Dreamhost • Dropbox • Drupal • Evernote • Eclipse Mining Consortium • Facebook • Gaia Online • Gandi.net • GitHub • Google Apps • Google Mail • HootSuite • Joomla • LastPass • Linode • LinOTP • LocalBitcoins • Linux • Microsoft account • Mt. Gox • Net4Game • Okcoin • Salesforce.com • Synology • SupportPoint • TACACS.net • Teamviewer • timetotrade • WordPress • Xat • XenForo ! !
GOOGLE AUTHENTICATOR APP
MODULES - OTP & QRPNG
CREATE A SECRET var OTP = require(‘otp’); function createUser(request, reply)
{ var otp = OTP({ name: request.params.username + '@demo' }); var filename = __dirname + '/data/' + request.params.username + ‘.json’; var content = JSON.stringify(otp, undefined, ' ‘); fs.writeFile(filename, content, function(err) { if (err) return reply(err); reply(otp.totpURL); }); }
TOTP - INFORMATION { "class": "OTP{@phidelta}", "name": "pipobscure@demo", "keySize": 32,
"codeLength": 6, “secret": “INJCM5ZXGEYW2QJJGN5TEW25LNAC6NLUFZYWK2CWIE2U2S3MIZIQ“, "epoch": 0, "timeSlice": 30 } otpauth://totp/pipobscure@demo?secret=INJCM5ZXGEYW2QJJGN5TEW25LNAC6NLUFZYWK2CWIE2U2S3MIZIQ
CREATE A QR-CODE otpauth://totp/pipobscure@demo?secret=INJCM5ZXGEYW2QJJGN5TEW25LNAC6NLUFZYWK2CWIE2U2S3MIZIQ var QR = require(‘qrpng’); function fetchQRCode(request,
reply) { var url = request.query.url; var scale = request.query.scale || 4; QR(url, scale, function(err, png) { if (err) return reply(err); reply(png).type('image/png'); }); }
VALIDATE A CODE function verifyCode(request, reply) { var filename =
__dirname + '/data/' + request.params.username + ‘.json'; fs.readFile(, 'utf-8', function(err, data) { if (err) return reply(err); var otp = JSON.parse(data, OTP.reviveJSON); ! if (String(otp.totp()) !== String(request.payload)) { return reply({ valid: false }).code(403); } ! reply({ valid: true }); }); }