PHP Classes

oAuth

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  oAuth  >  (Un) Subscribe thread alerts  
Subject:oAuth
Summary:Question about your plugin
Messages:2
Author:Alan Snow
Date:2015-06-24 19:18:31
 

  1. oAuth   Reply   Report abuse  
Picture of Alan Snow Alan Snow - 2015-06-24 19:18:31
Here is the scenario, Need to use Facebook oAuth login for users to register or login. Then after that user has been verified and logged in this also need to authenticate my own rest api. Is this possible with your plugin?

  2. Re: oAuth   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-06-24 19:25:09 - In reply to message 1 from Alan Snow
The OAuth client just grants you an authorization to access the Facebook (or other) API with the user permission.

What you can do is to use the class so you can call Facebook API to get his name and email address. That should be a starting point for you to create user records in your system, eventually asking him for a password.

Later you can let the user authenticate with his Facebook account using this OAuth class or let him login with his username or email and password.

If you take a look at the PHP Classes login system, it already works like that.

Take a look at the Facebook examples with this class to see how you can get the authorization to call Facebook API and get the user account details like name and email.