code samples for OAuth and OpenID