Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Created January 3, 2013 20:09
Show Gist options
  • Select an option

  • Save xjamundx/4446681 to your computer and use it in GitHub Desktop.

Select an option

Save xjamundx/4446681 to your computer and use it in GitHub Desktop.

OAuth 1.0A

Pros:

  1. Shared login without giving out your password. (Not our problem)
  2. "State-ful" security without cookies or HTTPS (sort-of)
  3. Ability to de-authorize

Cons:

  1. Super complicated signing algorithm (difficult for client to sign)

Users: Twitter, Flickr, LinkedIn

OAuth 2.0

Pros:

  1. Simpler way to accomplish authentication (bearer tokens, not signing)
  2. Additional options for securing things (may also use signing, etc.)
  3. Can also de-authorize clients (not super helpful for us)

Cons:

  1. HTTPS needed for security with bearer tokens
  2. Shorter lived authentication required, because of lower security threshhold
  3. No standard implementation. Each provider makes up their own rules.

Users: Google, Facebook, etc.

HTTPS w/sessions

Pros:

  1. Simple
  2. Secure
  3. SessionId could be stored in localStorage instead of cookies

Cons:

  1. HTTPS adds latency
  2. HTTPS adds overhead for servers
  3. Cookies can still get hijacked if your domain is only part HTTPS

Users: Facebook (non-API), Google (non-API), everyone else…..

HTTPS + Basic Auth

Pros;

  1. Simple
  2. Secure

Cons:

  1. We need to store password on the client
  2. We need to authenticate on every request

Users: github, gowalla, others

More References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment