2016-01-23 06:06:46 +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')
|
|
|
|
++ out (out-quay:auth 'access_token'^access-token)
|
|
|
|
++ in in-code:auth
|
2016-01-20 03:03:24 +03:00
|
|
|
++ bak
|
2016-01-23 06:06:46 +03:00
|
|
|
%- (bak-parse-access:auth . expires-in.aut ~)
|
|
|
|
|= [access-token=token.aut expires-in=@u]
|
|
|
|
=+ token-expires=`@da`(add now.bal (mul ~s1 expires-in))
|
2016-01-21 22:53:57 +03:00
|
|
|
~& authenticated-until/token-expires :: XX handle timeout
|
|
|
|
+>.$(access-token access-token)
|
2016-01-20 03:03:24 +03:00
|
|
|
--
|