Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to logout from facebook website using graph api in asp.net?


Asked by Olive Wang on Dec 03, 2021 ASP.NET



Below is the event handler which is raised when the Logout button is clicked, it simply makes call to the ASPSnippets FaceBook API Logout method and passes the FaceBook Graph API Access Code as parameter. 1. Press the Login button in order to login through FaceBook
Additionally,
The ASP.NET Core applications are secured using Microsoft.Identity.Web. In the API project, the Graph API client is used in a delegated flow with user access tokens getting an access token for the graph API on behalf of the identity created from the access token used to request the API.
Keeping this in consideration, The FacebookClient is responsible for handling the POST and GET requests to the Facebook API. Quite straightforward code, no magic here, just keep in mind to add a reference to the Newtonsoft.Json package. Our FacebookService is where the true “business logic” lays in.
In addition,
In the API project, the Graph API client is used in a delegated flow with user access tokens getting an access token for the graph API on behalf of the identity created from the access token used to request the API.
Moreover,
For instance, if your browser is old, it’s possible to click the logout button/link with no action taking place. In this case log in from a different browser/device and log out from there. If the site doesn’t allow multiple simultaneous logins to the same account, the new login will eliminate the old.