Docuquangphat - Tin kinh doanh, tài chính, ngân hàng, pháp luật mới 24h
  • Home
  • Kinh Doanh
  • Ngân Hàng
  • Pháp Luật
No Result
View All Result
  • Home
  • Kinh Doanh
  • Ngân Hàng
  • Pháp Luật
No Result
View All Result
Docuquangphat - Tin kinh doanh, tài chính, ngân hàng, pháp luật mới 24h
No Result
View All Result

Facebook Login & Graph API | JavaScript SDK

admin by admin
June 12, 2020
in Giải Trí
50
Facebook Login & Graph API | JavaScript SDK



In this freestyle coding video I will implement Facebook login using the JavaScript SDK and we will take a look at the Graph API. We will also be working with the Graph API explorer and taking a look at the different permissions that we can request with the access token

CODE: Code for this video

Graph API Explorer:

Register Facebook App:

SPONSORS:
DevMountain Bootcamp –

EDUONIX COURSES: Please use affiliate links from website below

SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:

FOLLOW TRAVERSY MEDIA:

Nguồn: https://docuquangphat.com/

Xem thêm bài viết khác: https://docuquangphat.com/giai-tri/

Xem thêm Bài Viết:

  • 1 phút để lấy lại mật khẩu Facebook khi không có Email và số điện thoại
  • #26 HIEN NGUYEN ACNE | Acne blackheads bumps on a perennial acne face
  • Chênh vênh | LOVEBUS | Năm 3 | Tập 124 | 120411
  • Nhìn lại buổi điều trần của ông chủ Facebook Mark Zuckerberg – Tin Tức VTV24
  • Facebook marketing 4.0 – Hướng Dẫn Xây Dựng Hệ Thống Bán Hàng Online Tự Động A-Z | Nguyễn Tất Kiểm
Previous Post

Tết Là Tết ♫ Mùa Xuân Ơi ♫ NHẠC TẾT THIẾU NHI VUI NHỘN HAY NHẤT

Next Post

Hoa Hòe | Công Dụng Của Hoa Hòe | Cách Sử Dụng Hoa Hòe

Next Post
Hoa Hòe | Công Dụng Của Hoa Hòe | Cách Sử Dụng Hoa Hòe

Hoa Hòe | Công Dụng Của Hoa Hòe | Cách Sử Dụng Hoa Hòe

Comments 50

  1. Abrafge Svbeac says:
    2 years ago

    Thank you so much for all the work and for sharing your knowledge! Your tutorials help so much!
    Even if the topic was really hard for me at first attempt, after your tutorial I start to make progress, thank you very much!!

    Reply
  2. Siosaia Fonua says:
    2 years ago

    Is there documentation on doing this in reactjs?

    Reply
  3. Muti Ullah says:
    2 years ago

    Many Thanks for the tutorial i really needed it

    Reply
  4. Nguyễn Cao Tài says:
    2 years ago

    Can you push seri auto like facebook Grap api for people?

    Reply
  5. Stefan Venter says:
    2 years ago

    thank you so much for this video! This was exactly what I was looking for. All the basics I need to get started. There is a ton of documentation on this Facebook graph which is kind of overwhelming, but this video made it easy to get started.

    Reply
  6. cristian morales says:
    2 years ago

    muy bueno, me ayudo bastante.

    Reply
  7. Sam says:
    2 years ago

    Nobody:
    Brad: Ahhmmmm Excuse Me!!

    Really love cool stuff from you.. <3 I have seen a couple of videos of yours and you are just awesome… Love form Pakistan <3
    Never mind of that little meme joke.. I have seen you doing this in other videos 😀

    Reply
  8. MayaSecond Fleht says:
    2 years ago

    Ich hatte nur einen einfachen Monat

    Reply
  9. MayaSecond Fleht says:
    2 years ago

    https://api.video/

    Reply
  10. Riley Seaburg says:
    2 years ago

    Bruh

    Reply
  11. Salom Dunyo says:
    2 years ago

    Hello, the video is outdated almost.
    what I wanted is guide for using Instagram with a WEBHOOK feature. or Instagram GRAPH.
    thank you in advance.

    Reply
  12. Abhishek Shah says:
    2 years ago

    Awesome video

    Reply
  13. flashteQ says:
    2 years ago

    brilliant brad

    Reply
  14. StockholmStadion says:
    2 years ago

    What would we do without you?

    Reply
  15. Devashan Pillay says:
    2 years ago

    when i opened up with live server it gave me this:

    The method FB.getLoginStatus can no longer be called from http pages
    Facebook Login status is only available to HTTPS pages.

    what am i doing wrong? i made the folders and and index document manually, I didnt understand the method he used. I am a beginner at this stuff.

    Reply
  16. Mike Mandala says:
    2 years ago

    to retrieve using php you can go this route see code below

    require_once( 'C:fakepathvendorfacebookgraph-sdksrcFacebookautoload.php' );

    class Facebook {

    public $ci;

    public $accessToken;

    public $fb;

    public function __construct() {

    // Get CI object.

    $this->ci =& get_instance();

    $this->fb = new FacebookFacebook([

    'app_id' => *"your-app-id"*,

    'app_secret' => *"your-app-secret"*,

    'default_graph_version' => 'v2.10',

    //'default_access_token' => '{access-token}', // optional

    ]);

    }

    public function login(){

    $helper = $this->fb->getRedirectLoginHelper();

    $permissions = ['email','publish_to_groups','publish_pages'];
    //you can visit the facebook page and add more scopes
    $loginUrl = $helper->getLoginUrl(base_url('/client/FaceBookHandler'), $permissions);

    echo '<script>window.open("'.$loginUrl.'", "Facebook Popup", "height=500,width=400,resizable=no");</script>';
    //custom popup window
    }

    public function getAccessToken(){

    $helper = $this->fb->getRedirectLoginHelper();

    $accessToken = '';

    try {

    $accessToken = $helper->getAccessToken();

    } catch(FacebookExceptionsFacebookResponseException $e) {

    return false;

    } catch(FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    $oAuth2Client = $this->fb->getOAuth2Client();

    $tokenMetadata = $oAuth2Client->debugToken($accessToken);

    $tokenMetadata->validateAppId("*your-app-id*");

    $tokenMetadata->validateExpiration();

    if (! $accessToken->isLongLived()) {

    try {

    $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);

    } catch (FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    }

    if(isset($accessToken) && !empty($accessToken)){

    return $accessToken;

    }

    return false;

    }

    /*Seeting the access token */
    public function setAccessToken($token){

    //$_SESSION['fb_access_token'] = (string) $accessToken;

    $_SESSION['fb_access_token'] = (string) $token->getValue();

    $_SESSION['fb_expires_at'] = strtotime($token->getExpiresAt()->format('Y-m-d H:i:s'));

    try {

    $response = $this->fb->get('/me?fields=id,name', (string) $token->getValue());

    } catch(FacebookExceptionsFacebookResponseException $e) {

    return false;

    } catch(FacebookExceptionsFacebookSDKException $e) {

    return false;

    }

    $user = $response->getGraphUser();

    $_SESSION['fb_user_id'] = $user->getId();

    return array(

    'fb_access_token'=>(string) $token->getValue(),

    'fb_expires_at'=>strtotime($token->getExpiresAt()->format('Y-m-d H:i:s')),

    'fb_user_id',$user->getId());

    }

    }

    /*Testing the code*/
    public function RequestBlogs(){

    // echo "my user id = ".$_SESSION['fb_user_id'];

    echo $this->face->login();

    }

    public function FaceBookHandler(){

    $token = $this->face->getAccessToken();

    if($token != false){

    $result = $this->face->setAccessToken($token);

    if($result != false){

    print_r($result);

    }else{

    echo "Failed to set access token";

    }

    }else{

    echo "Login Failed";

    }

    Reply
  17. Ignacio Ainol says:
    2 years ago

    excellent contribution thank you very much. Greetings from Chile

    Reply
  18. Junior Commandant says:
    2 years ago

    Thanks a lot for this tuto . How can we change the style of the facebook button?

    Reply
  19. Crypto Currency says:
    2 years ago

    Can you please share with me the code here?

    Reply
  20. Crypto Currency says:
    2 years ago

    Great channel. Thank you so much for sharing all your knowledge. You helped me out so much on understanding a wide variety of frameworks and what they do. Thank you sir!

    Reply
  21. Traduções PtBr Internacionais Séries Filmes Novelas says:
    2 years ago

    Yes!

    Reply
  22. *M A R S* says:
    2 years ago

    Damn I like that voice

    Reply
  23. mlk__Zica Da erivan says:
    2 years ago

    Oi
    Kkkk
    FALANDO

    Reply
  24. Petit Camus says:
    2 years ago

    Traversy. always up to date

    Reply
  25. Mahathir Mohammad says:
    2 years ago

    salute you thousand time. thanks from core of my heart. i learn graph api from this video and make money $$.

    Reply
  26. Niklas Hultgren says:
    2 years ago

    Great tutorial Brad! Keep up the good work!

    Reply
  27. Lister Matrix says:
    2 years ago

    thank you sir

    Reply
  28. Asis Tacilo says:
    2 years ago

    the logout function will never logout me, idk why

    Reply
  29. Ali emiroğlu says:
    2 years ago

    bootstrap well is deprecated use card instead

    Reply
  30. Jacobus Strydom says:
    2 years ago

    Love how you just tell the know it all's not to be a dick. Thumbs up just for that

    Reply
  31. Emre TATBAK says:
    2 years ago

    I am having "404 Not Found Error" why?

    Reply
  32. Professionnel Hacker says:
    2 years ago

    thank you so much now we can hack any account in facebook

    Reply
  33. Tuhidul islam Mridul says:
    2 years ago

    best teacher in the world , love you sir

    Reply
  34. Rasmus Björklund says:
    2 years ago

    Could you make one of these for php too?

    Reply
  35. Mattias Graaf says:
    2 years ago

    Thanks alot for this video. This video helped me to finally implement facebook login for my site. 😀

    Reply
  36. JUAN says:
    2 years ago

    Is there a way to create a Facebook app automatically? with a library or something?

    Reply
  37. Andrew Sabato says:
    2 years ago

    The CSS in 2019 breaks this project when cloned from your github. Although not the point of this video, custom css would make this video last longer

    Reply
  38. Nikhil Hukkerikar says:
    2 years ago

    Brad – I googled for facebook login api tutorial and your video pops up so just know that there's always someone with a wisea** know it all comment on more than one of your videos but I would say this great job man keep up the good work and know that you are helping a lot of us devs in your videos and it means a lot to us so ignore them and keep doing what you do the best!
    Happy new year in advance and hope to see you next year with even more amazing videos like this one cheers!

    Reply
  39. crazy idea says:
    2 years ago

    thank u so much

    Reply
  40. Han Jiang says:
    2 years ago

    Great tutorial THanks!

    Reply
  41. Jayabal A says:
    2 years ago

    Insecure login blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https://

    Reply
  42. Prafulla Raichurkar says:
    2 years ago

    really helpful , thanks Brad!

    Reply
  43. mohammed farhat says:
    2 years ago

    coooooool

    Reply
  44. Akash Patel says:
    2 years ago

    Really helpful video. Thanks!

    Reply
  45. Jack Bugeja says:
    2 years ago

    Great videos. I was wondering if it is possible to extract posts on my newsfeed to check the reactions on the posts my friends and followed pages post for statistical (education) purposes? Thanks

    Reply
  46. Nadeem Gorsi says:
    2 years ago

    Pls make a video about Google login.. Thankx nd Happy Coding..

    Reply
  47. Debojit Acharjee says:
    2 years ago

    I TRIED TO CREATE FACEBOOK ACCOUNT BY RESETTING MY IP ADDRESS OF MODEM AND IT WAS CREATED BUT WHEN I TRIED TO CREATE MORE FB ACCOUNTS I STARED TO GET CAPTCHA VERIFICATION EVEN AFTER CHANGING THE IP ADDRESS OF THE MODEM. So my question is… HOW FB IS ABLE TO FIND THAT I AM TRYING TO CREATE MULTIPLE ACCOUNTS EVEN AFTER CHANGING THE IP ADDRESSES?

    Reply
  48. Can DMN says:
    2 years ago

    c

    Reply
  49. Can DMN says:
    2 years ago

    b

    Reply
  50. Can DMN says:
    2 years ago

    b

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

[ LES BÉBÉS] BÌNH SỮA SILICON PUTTI ATTI HÀN QUỐC

[ LES BÉBÉS] BÌNH SỮA SILICON PUTTI ATTI HÀN QUỐC

June 20, 2020
[ Mua – Bán Bitcoin ] – Bitcoin Cash sẽ tác động vào Bitcoin và Ethereum như thế nào ?

[ Mua – Bán Bitcoin ] – Bitcoin Cash sẽ tác động vào Bitcoin và Ethereum như thế nào ?

June 16, 2020
[ Mua – Bán Bitcoin ] – DUBAI ra mắt dự án bất động sản đầu tiên thanh toán bằng BITCOIN

[ Mua – Bán Bitcoin ] – DUBAI ra mắt dự án bất động sản đầu tiên thanh toán bằng BITCOIN

June 19, 2020
[ Mua – Bán Bitcoin ] – Đồng tiền ảo Bitcoin Cash tăng 200% giá trị sau khi phân tách

[ Mua – Bán Bitcoin ] – Đồng tiền ảo Bitcoin Cash tăng 200% giá trị sau khi phân tách

June 16, 2020
[ Mua – Bán Bitcoin] – Bitcoin Cash là gì? – Điều bạn cần biết trước khi đầu tư?

[ Mua – Bán Bitcoin] – Bitcoin Cash là gì? – Điều bạn cần biết trước khi đầu tư?

June 11, 2020
[FRIDAY BOX] Unbox Vali Bikini Đi Biển Cho Mùa Hè Sôi Động Cùng Mel TV

[FRIDAY BOX] Unbox Vali Bikini Đi Biển Cho Mùa Hè Sôi Động Cùng Mel TV

June 9, 2020
  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Kinh Doanh
  • Ngân Hàng
  • Pháp Luật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.