在Google App Engine自定义Authenticator
中,谷歌访问令牌收到
String accessToken = req.getHeader("Authorization")
然而,为了检索facebook访问令牌,我尝试了一些选项,但没有成功。
String code = req.getParameter("code");
String code = req.getParameter("access_token");
请告诉我如何检索Facebook访问令牌。
答案 0 :(得分:0)
的Android
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(this.getApplicationContext());
accessToken = AccessToken.getCurrentAccessToken();
}
的iOS
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *accessToken = [FBSDKAccessToken currentAccessToken];
}
JavaScript(Web)
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
var accessToken = response.authResponse.accessToken;
}
} );