[英]how to instantiate verifier when using scribe for facebook authentication
I am testing scribe for facebook authentication. 我正在测试抄写员的Facebook身份验证。 I am not receiving the oauth_verifier when authenticating against facebook - let me know if this is incorrect behavior.
针对Facebook进行身份验证时,我没有收到oauth_verifier-如果这是不正确的行为,请告诉我。 For facebook auth, how should I go about creating the verifier in order to create the OAuthRequest.
对于facebook auth,我应该如何创建验证器才能创建OAuthRequest。
redirect_uri=http%3A%2F%2Flocalhost%2Foauth%2Ffacebook
Thanks 谢谢
LoginServlet: LoginServlet:
public void doGet(HttpServletRequest req, HttpServletResponse res) {
OAuthService service = new ServiceBuilder().provider(FacebookApi.class).apiKey(FACEBBOK_APP_KEY)
.apiSecret(FACEBOOK_APP_SECRET).callback(FACEBOOK_CALLBACK);
String authenticationUrl = service.getAuthorizationUrl(null);
res.sendRedirect(authenticationUrl);
}
CallbackServlet: CallbackServlet:
public void doGet(HttpServletRequest req, HttpServletResponse res) {
String code = "";
Enumeration paramEnum = req.getParameterNames();
while (paramEnum.hasMoreElements()) {
String name = (String) paramEnum.nextElement();
if (name.equals("code")) {
code = req.getParameter(name);
}
OAuthService service = new ServiceBuilder().provider(FacebookApi.class).apiKey(FACEBBOK_APP_KEY)
.apiSecret(FACEBOOK_APP_SECRET).callback(FACEBOOK_CALLBACK);
Verifier verifier = new Verifier(code);
//....
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.