当前位置: 首页>>代码示例>>Java>>正文


Java OAuthProvider类代码示例

本文整理汇总了Java中oauth.signpost.OAuthProvider的典型用法代码示例。如果您正苦于以下问题:Java OAuthProvider类的具体用法?Java OAuthProvider怎么用?Java OAuthProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OAuthProvider类属于oauth.signpost包,在下文中一共展示了OAuthProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setHttpClient

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
/**
 * Use a specific {@link HttpClient} for HTTP traffic.
 *
 * @param httpClient
 * {@link HttpClient}, that is used for HTTP communication
 */
public synchronized void setHttpClient( HttpClient httpClient )
{
  this.httpClient = httpClient;

  // register HTTP client in the OAuth provider
  try
  {
    OAuthProvider p = getAuthProvider();
    if (p instanceof CommonsHttpOAuthProvider)
    {
      ((CommonsHttpOAuthProvider) p).setHttpClient( httpClient );
    }
  }
  catch (OAuthNotAuthorizedException ex)
  {
  }
}
 
开发者ID:OpenEstate,项目名称:OpenEstate-IS24-REST,代码行数:24,代码来源:HttpComponents43Client.java

示例2: getProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
private OAuthProvider getProvider() {
	
	// use our http client that accepts self-signed certificates
	DefaultHttpClient httpclient = MySSLSocketFactory.getNewHttpClient();
	
	// Use the provider bundled with signpost, the android libs are buggy
	// See: http://code.google.com/p/oauth-signpost/issues/detail?id=20
	OAuthProvider provider = new CommonsHttpOAuthProvider(
			requestTokenUrl,
			accessTokenUrl,
			authorizeUrl,
			httpclient);
	provider.setOAuth10a(oauth10a);
	
	return provider;
}
 
开发者ID:Tomdroidd,项目名称:tomdroid,代码行数:17,代码来源:OAuthConnection.java

示例3: loadInBackground

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
@Override
public URL loadInBackground() {
	
	NoteblurApplication app = (NoteblurApplication) getContext().getApplicationContext();
	OAuthConsumer consumer = app.consumer;
	OAuthProvider provider = app.provider;		
	try {
		String authUrl = provider
				.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);
		
		SharedPreferences prefs = getContext().getSharedPreferences("bob", 0);
		prefs.edit().putString("TOKEN", consumer.getToken())
					.putString("SECRET", consumer.getTokenSecret())
					.commit();
		
		
		return new URL(authUrl);
	} catch (Exception e) {
		Log.e(TAG, e.getMessage(), e);
		throw new RuntimeException(e);
	}

}
 
开发者ID:secondsun,项目名称:devnexus2013demo,代码行数:24,代码来源:OAuthFetcherLoader.java

示例4: create

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public static OAuthWebViewDialogFragment create(@NonNull OAuthConsumer consumer,
                                                @NonNull OAuthProvider provider) {
    OAuthWebViewDialogFragment f = new OAuthWebViewDialogFragment();

    Bundle args = new Bundle();
    args.putSerializable(CONSUMER, consumer);
    args.putSerializable(PROVIDER, provider);
    f.setArguments(args);

    return f;
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:12,代码来源:OAuthWebViewDialogFragment.java

示例5: oAuthProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
@Provides public static OAuthProvider oAuthProvider()
{
	return new DefaultOAuthProvider(
			BASE_OAUTH_URL + "request_token",
			BASE_OAUTH_URL + "access_token",
			BASE_OAUTH_URL + "authorize");
}
 
开发者ID:westnordost,项目名称:StreetComplete,代码行数:8,代码来源:OAuthModule.java

示例6: buildOAuthProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
@Override
protected OAuthProvider buildOAuthProvider( String apiBaseUrl )
{
  if (httpClient==null) setDefaultHttpClient();
  return new CommonsHttpOAuthProvider(
    apiBaseUrl + "/security/oauth/request_token",
    apiBaseUrl + "/security/oauth/access_token",
    apiBaseUrl + "/security/oauth/confirm_access",
    httpClient );
}
 
开发者ID:OpenEstate,项目名称:OpenEstate-IS24-REST,代码行数:11,代码来源:HttpComponents43Client.java

示例7: RetrieveAccessTokenTask

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public RetrieveAccessTokenTask(Context context, OAuthConsumer consumer,OAuthProvider provider, SharedPreferences prefs) {
	
	this.context = context;
	this.consumer = consumer;
	this.provider = provider;
	this.prefs=prefs;
}
 
开发者ID:OneStopTransport,项目名称:OAuth-1-android-demo,代码行数:8,代码来源:RetrieveAccessTokenTask.java

示例8: buildProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
/**
 * Builds an {@see OAuthProvider} based on these parameters and a OAuth consumer <code>consumer</code>.
 * 
 * @return the provider
 * @throws IllegalArgumentException thrown if consumer is null
 */
public OAuthProvider buildProvider() throws IllegalArgumentException {
    
    return new CommonsHttpOAuthProvider(
            requestTokenUrl,
            accessTokenUrl,
            authoriseUrl
    );
}
 
开发者ID:Mapzen-POI-Collector,项目名称:Mapzen-Android,代码行数:15,代码来源:OAuthParameters.java

示例9: loadInBackground

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
@Override
public String loadInBackground() {
	
	NoteblurApplication app = (NoteblurApplication) getContext().getApplicationContext();
	OAuthConsumer consumer = app.consumer;
	OAuthProvider provider = app.provider;
	try {
		
		provider.retrieveAccessToken(consumer, pin);

		URL url = new URL("http://api.tumblr.com/v2/user/info");
		HttpURLConnection request = (HttpURLConnection) url
				.openConnection();

		consumer.sign(request);

		InputStream stream = request.getInputStream();

		BufferedReader r = new BufferedReader(new InputStreamReader(stream));
		StringBuilder total = new StringBuilder();
		String line;
		while ((line = r.readLine()) != null) {
			total.append(line);
		}

		return total.toString();

	} catch (Exception e) {
		Log.e(TAG, e.getMessage(), e);
		throw new RuntimeException(e);
	}
}
 
开发者ID:secondsun,项目名称:devnexus2013demo,代码行数:33,代码来源:AccountInfoLoader.java

示例10: createProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public static OAuthProvider createProvider() {
    return new DefaultOAuthProvider(
            BASE_OAUTH_URL + "request_token",
            BASE_OAUTH_URL + "access_token",
            BASE_OAUTH_URL + "authorize");
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:7,代码来源:OAuth.java

示例11: getProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public OAuthProvider getProvider() {
    return provider;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:4,代码来源:OAuth.java

示例12: GetOSMAuthProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public static OAuthProvider GetOSMAuthProvider(Context ctx) {
	return new CommonsHttpOAuthProvider(ctx.getString(R.string.osm_requesttoken_url),
			ctx.getString(R.string.osm_accesstoken_url), ctx.getString(R.string.osm_authorize_url));
}
 
开发者ID:scintero,项目名称:moveon,代码行数:5,代码来源:OSMHelper.java

示例13: OAuthRequestTokenTask

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public OAuthRequestTokenTask(Context context, OAuthConsumer consumer,OAuthProvider provider, WebView webView) {
	this.consumer = consumer;
	this.provider = provider;
	this.dialog = new ProgressDialog(context);
	this.webView = webView;
}
 
开发者ID:Nikhil-Nandagopal,项目名称:Socialite,代码行数:7,代码来源:OAuthRequestTokenTask.java

示例14: RetrieveAccessTokenTask

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public RetrieveAccessTokenTask(Context context, OAuthConsumer consumer, OAuthProvider provider) {
	this.context = context;
	this.consumer = consumer;
	this.provider = provider;
}
 
开发者ID:Nikhil-Nandagopal,项目名称:Socialite,代码行数:6,代码来源:RetrieveAccessTokenTask.java

示例15: getOAuthProvider

import oauth.signpost.OAuthProvider; //导入依赖的package包/类
public static OAuthProvider getOAuthProvider() {
	return provider;
}
 
开发者ID:Nikhil-Nandagopal,项目名称:Socialite,代码行数:4,代码来源:TwitterConnector.java


注:本文中的oauth.signpost.OAuthProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。