OAuth is a framework for access delegation. What it does is giving access to a website or a web application to get the information on another website or web application.
This is how the OAuth works
1. When the user don't have account, user asks the application to login with third-party services like Facebook/LinkedIn.
2. The application asks the user get permission from Facebook/ third-party services.
3. User ask third-party application to give permission for the application.
4. Third-party application give authorization code for the application to get access to resources.
5. Using the authorization code user get the token from the third-party application.
6. By using the token application get information needed.
7. Now the user is login with the application as a valid user .
To register visit to https://developers.facebook.com/ and login to it using your Facebook email and password. The home page is shown in Figure 01.

Figure 01
Then go to the My Apps list ,create new app and get the app ID and the secret key.


This is how the OAuth works
1. When the user don't have account, user asks the application to login with third-party services like Facebook/LinkedIn.
2. The application asks the user get permission from Facebook/ third-party services.
3. User ask third-party application to give permission for the application.
4. Third-party application give authorization code for the application to get access to resources.
5. Using the authorization code user get the token from the third-party application.
6. By using the token application get information needed.
7. Now the user is login with the application as a valid user .
Register the application
To register visit to https://developers.facebook.com/ and login to it using your Facebook email and password. The home page is shown in Figure 01.

Figure 01
Then go to the My Apps list ,create new app and get the app ID and the secret key.


Implementation
While we implementing the code we should wants to start the session and then copy the app Id and the app secret key.
After that we will implement code for the login page. Here we will get the authorization from the Facebook. When we login with the Facebook it will require permission. If the permission is granted app will get the access token.
Then create the 'fbcallback.php' to send request to the resource server of Facebook with access token. If the permission is given the resource server returns the information to the app.
When we get the permission we can get access what we want
If the authorization success the we can go through the application
Comments
Post a Comment