Decrypt or decode Facebook access token from Facebook Graph iOS SDK -
the facebook ios sdk granting encrypted or encoded access tokens in format:
v9ylvkttpnufwux4kvdjdpb0srxkukx7z281rqjhug0.eyjpdii6imewwxbdaetncwpdtu5ibunuqwdrowcifq.y-dwxry2zafzip7evur-hksxqmgw9lxp6umgrfz2xnjslm0a508u7_jxq0_kz5a2s8auuulzuvirvxts51_i6vfsbyocbfbikobe0-n-pa8nc29wbuvmgjlvq4w-ezhv0dza3diiciqcybt9eldxoa
using oauth on web, facebook provides unencrypted / unencoded access tokens in format (this 1 not real):
213455681425|1.bggrgnfwrdpg_x18.3600.1213252135.2-1334679|dhcdbxgbeyblg3srgw12fdf4gd60
how can decrypt/decode ios access token can read expiration unix time value , user id can unencoded tokens? reason need expiration date determine when expires, , need user id publish appid|appsecret style access token in event access token expired yet user hasn't revoked publish_stream access.
that access token never expires since has offline_access permission. see here.
in case looks user expired access token de-authorizing app or changing his/her password. mitigate against this, using app deauthorization callback url. here's more details:
when user of app removes in app dashboard or blocks app in news feed, app can notified specifying deauthorize callback url in developer app. during app removal send http post request containing single parameter, signed_request, contains user id (uid) of user removed app. not receive user access token in request , existing user access tokens automatically expired.
Comments
Post a Comment