我正在开发一个项目,用于在不同的社交网络上提取数据用户,包括Facebook和Java。我实际上因为Oauth2.0
的问题而被阻止,我使用Scribe获取授权,但只是运行代码给出的代码:
OAuthService service = new ServiceBuilder()
.provider(FacebookApi.class)
.apiKey(apiKey)
.apiSecret(apiSecret)
.callback("https://www.facebook.com/connect/login_success.html?code=")
.build();
Scanner in = new Scanner(System.in);
System.out.println("=== " + NETWORK_NAME + "'s OAuth Workflow ===");
System.out.println();
// Obtain the Authorization URL
System.out.println("Fetching the Authorization URL...");
String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);
System.out.println("Got the Authorization URL!");
System.out.println("Now go and authorize Scribe here:");
System.out.println(authorizationUrl);
System.out.println("And paste the authorization code here");
System.out.print(">>");
Verifier verifier = new Verifier(in.nextLine());
但是在firefox上传递authorizationUrl后,我收到以下消息:
成功
AVERTISSEMENT DE SÉCURITÉ : traitez l’URL ci-dessous comme un mot de passe et ne la partagez avec personne.
但是没有代码可以用来获取访问令牌..
。 我没有遇到问题,有人能帮助我吗?