本文整理匯總了Java中org.scribe.builder.ServiceBuilder.apiSecret方法的典型用法代碼示例。如果您正苦於以下問題:Java ServiceBuilder.apiSecret方法的具體用法?Java ServiceBuilder.apiSecret怎麽用?Java ServiceBuilder.apiSecret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.scribe.builder.ServiceBuilder
的用法示例。
在下文中一共展示了ServiceBuilder.apiSecret方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getService
import org.scribe.builder.ServiceBuilder; //導入方法依賴的package包/類
/**
* Gets the OAuth service singleton.
*
* @return OAuth service singleton
*/
protected OAuthService getService() {
if (service == null) {
callbackPage = Page.getCurrent();
String location = callbackPage.getLocation().toString();
Class<? extends Api> api = getApi();
ServiceBuilder builder = new ServiceBuilder();
builder.provider(api);
builder.apiKey(apiKey);
builder.apiSecret(apiSecret);
builder.callback(location);
service=builder.build();
}
return service;
}
示例2: createService
import org.scribe.builder.ServiceBuilder; //導入方法依賴的package包/類
private OAuthService createService() {
ServiceBuilder sb = new ServiceBuilder();
sb.provider(Google2Api.class);
sb.apiKey(GOOGLE_API_KEY);
sb.apiSecret(GOOGLE_API_SECRET);
sb.scope("email");
// redirectUrl = Page.getCurrent().getLocation().toString()+"dashboard/";
redirectUrl = Page.getCurrent().getLocation().toString();
if(redirectUrl.contains("#")) {
redirectUrl = redirectUrl.substring(0, redirectUrl.indexOf("#"));
}
sb.callback(redirectUrl);
return sb.build();
}
示例3: createOAuthService
import org.scribe.builder.ServiceBuilder; //導入方法依賴的package包/類
private OAuthService createOAuthService() {
ServiceBuilder sb = new ServiceBuilder();
sb.provider(service.scribeApi);
sb.apiKey(service.apiKey);
sb.apiSecret(service.apiSecret);
sb.callback("http://www.google.fi");
return sb.build();
}