B
B
BonBon Slick2021-07-03 14:35:15
Facebook
BonBon Slick, 2021-07-03 14:35:15

Bug API and outdated docks?

expiresIn returns 1970

status: 'connected',
    authResponse: {
        accessToken: '{access-token}',
        expiresIn:'{unix-timestamp}',
        reauthorize_required_in:'{seconds-until-token-expires}',
        signedRequest:'{signed-parameter}',
        userID:'{user-id}'
    }

Is that how it's meant to be?

And yet, when the user calls the api, there is no email, and then what is their broken api that they do not support at all?
GuzzleHttp\Psr7\Request {#833
  -method: "GET"
  -requestTarget: null
  -uri: GuzzleHttp\Psr7\Uri {#834
    -scheme: "https"
    -userInfo: ""
    -host: "graph.facebook.com"
    -port: null
    -path: "/v3.3/me"
    -query: "fields=id,name,first_name,last_name,email,hometown,picture.type(large)%7Burl,is_silhouette%7D,gender,age_range&access_token=***"
    -fragment: ""
  }
  -headers: array:1 [
    "Host" => array:1 [
      0 => "graph.facebook.com"
    ]
  ]
  -headerNames: array:1 [
    "host" => "Host"
  ]
  -protocol: "1.1"
  -stream: null
}
^ array:5 [
  "id" => "***"
  "name" => "*** ***"
  "first_name" => "***"
  "last_name" => "***"
  "picture" => array:1 [
    "data" => array:2 [
      "url" => "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2701265266821013&height=200&width=200&ext=1627903864&hash=AeQXNyk4SXURQRffIBk"
      "is_silhouette" => false
    ]
  ]
]


Tested
//'graphApiVersion' => 'v3.3',
//'graphApiVersion' => 'v2.8',
'graphApiVersion' => 'v2.10',


UPD.
Email may not be returned for reasons
  1. no email, untied, for example, when a user uses a phone to log in
  2. you need to add scope fields in the authorization request
  3. but before adding copes they must be requested in the developer account, by default only the name can be returned only the very minimum as in the code above
  4. email not verified
  5. the email has been verified but requires reverification as a result of some actions
  6. no primary email, expose secondary email is not included in the API

The absence of an email will cause an authentication error, and it is unrealistic to programmatically determine why there is no email.
The user leaves the site because he could not log in through his favorite fubuk

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question