Adding Google & Facebook Login Without a Framework

Adding Google & Facebook Login Without a Framework

Comments and likes need an identity, but I didn't want to force visitors to create yet another password. OAuth2 with Google and Facebook solves this without a framework or SDK.

This post covers the authorization code flow: redirect, callback, token exchange, and storing the profile in the users table.

OAuth flow diagram

All done with plain cURL requests and a handful of session variables.

Comments (0)