add login via google, facebook, yahoo or live using azure mobile services

35
Peter Kellner Microsoft MVP 7 Years Silicon Valley Code Camp Organizer Pluralsight Author Independent

Upload: peter-kellner

Post on 18-Jan-2015

249 views

Category:

Software


0 download

DESCRIPTION

Talk for Bay.Net (San Francisco) June 18th, 2014 http://www.meetup.com/BayNET/events/185540132/ Avoid all the security issues of maintaining your own password storage and authentication with or without having your web site hosted on Azure. That is, allow your users to be able to login to your site by authenticating with Google, Facebook, Yahoo or Windows Live authorization services. In this presentation, I’ll show you how, with Azure Mobile Services and very simple API calls you can create that authentication.

TRANSCRIPT

Page 1: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Peter Kellner

•Microsoft MVP 7 Years

•Silicon Valley Code Camp Organizer

•Pluralsight Author

•Independent

Page 2: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Add Login via Google,

Facebook, Yahoo or LIVE using Azure Mobile

Services

Page 3: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

PLEASE LOGIN TOW.SVCC.MOBI

alias for www.siliconvalley-codecamp.com

Page 4: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

SVCC Walk Through

Page 5: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Problems?

• User Logs In Without First Linking

•Multiple Accounts (me!)

• Cookies?

Page 6: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

IDENTITY BASICS• I’m struggling to understand how to integrate these

oauth providers into my sites.  If all we get back is a token with no other identifiable information, how does this help us?  It seems that all we are getting is the ability for a bad guy to consistently identify himself to us with no other way of telling who he is.  Just, “same old bad guy is back”.

Yes, that’s pretty much OAuth in a nutshell. You get a consistent identifier per user. The format of that identifier is up to the provider. You may, or may not, get additional information, in the token, or via a side channel.

Page 7: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

UNIQUE NUMBER UNIQUE?

• My APP

• Your APP

• SAME UNIQUE NUMBER?

Page 8: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

INFORMATION FLOW

Issue Request To Identity Provider

Get Back Big Number String

Page 9: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

What is Azure Mobile Services?

•Web Site? (NO!)

•Tables, Blobs, Queues, Auth

Page 10: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Portal Run ThroughCreating Azure Mobile

ServiceWith Identities

Page 11: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Windows Azure Portal

Page 12: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 13: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 14: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 15: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 16: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 17: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 18: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Services Setup

Page 19: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Creating Apps

Page 20: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Creating Apps

Page 22: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Service-Directed Login

Page 23: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Code Time!

• Demo TestOAuth.html

Page 24: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Service-Directed Login

Page 25: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Service-Directed Login

Page 26: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Service-Directed Login

Page 27: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Service-Directed Login

Page 28: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Client-Directed Login

If your app doesn’t need to interact directly with the identity provider, you can instead use the Service-directed login operation

Page 29: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

SVCC Implementation

Page 30: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services
Page 31: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Extended OAuth Info

http://blogs.msdn.com/b/carlosfigueira/archive/2013/12/12/expanded-login-scopes-in-azure-mobile-services.aspx

Page 32: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Carlos Figueira Blog

Page 33: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services
Page 34: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

NodeJS Discussion

• Azure Mobile Service Integration

• Requires

• GIT

Page 35: Add Login via Google, Facebook, Yahoo or LIVE using Azure Mobile Services

Azure Mobile Service API Calls