shrub/sec/com/facebook/graph.hoon

19 lines
617 B
Plaintext
Raw Normal View History

2016-01-26 01:49:38 +03:00
/+ oauth2
2016-01-20 03:03:24 +03:00
::
::::
::
2016-01-23 06:06:46 +03:00
=+ [`/com/facebook/www /dialog/oauth response-type/%code ~]
=+ aut=(oauth2 - /'v2.3'/oauth/'access_token')
|_ [bal=(bale keys.aut) access-token=token.aut]
++ auth ~(. aut bal /'user_about_me'/'user_posts')
2016-01-27 04:44:14 +03:00
++ out (out-quay:auth 'access_token'^access-token)
2016-01-23 06:06:46 +03:00
++ in in-code:auth
2016-01-20 03:03:24 +03:00
++ bak
%- (bak-parse:auth . access-token.aut expires-in.aut ~)
|= [access-token=@t expires-in=@u]
?: (lth expires-in ^~((div ~d7 ~s1))) :: short-lived token
(toke-req:auth 'fb_exchange_token' fb-exchange-token/access-token ~)
[[%redo ~] ..bak(access-token access-token)]
::++ wyp ~
2016-01-20 03:03:24 +03:00
--