provider.setOAuth10a(true);
public OAuth(ServiceInfo info, boolean use10a) { this.info = info; this.provider = new CommonsHttpOAuthProvider(info.requestTokenURL, info.accessTokenURL, info.authorizationURL); this.provider.setOAuth10a(use10a); }
public OAuth(ServiceInfo info, boolean use10a) { this.info = info; this.provider = new CommonsHttpOAuthProvider(info.requestTokenURL, info.accessTokenURL, info.authorizationURL); this.provider.setOAuth10a(use10a); }
private OAuth(ServiceInfo info) { this.info = info; provider = new DefaultOAuthProvider(info.requestTokenURL, info.accessTokenURL, info.authorizationURL); provider.setOAuth10a(true); }
private OAuthConsumer consumer; private OAuthProvider provider; ... ... ... provider = new CommonsHttpOAuthProvider ( TWITTER_REQUEST_TOKEN_URL, TWITTER_ACCESS_TOKEN_URL, TWITTER_AUTHORIZE_URL); private void askOAuth() { try { consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); provider = new CommonsHttpOAuthProvider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize"); provider.setOAuth10a(true); String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL); Toast.makeText(this, "Please authorize this app!", Toast.LENGTH_LONG).show(); this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl))); } catch (Exception e) { Log.e(APP, e.getMessage()); Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show(); } }
/** * Initializes client with access credentials. * * @param accessToken token for permanent access to the IS24-Webservice * @param accessSecret secret for permanent access to the IS24-Webservice * @throws OAuthException if initialization of the authorization failed */ @SuppressWarnings("RedundantThrows") public final void authorize(String accessToken, String accessSecret) throws OAuthException { this.oAuthConsumer = buildOAuthConsumer(this.consumerToken, this.consumerSecret); this.oAuthConsumer.setTokenWithSecret(accessToken, accessSecret); this.oAuthProvider = buildOAuthProvider(apiBaseUrl); this.oAuthProvider.setOAuth10a(true); }
provider.setOAuth10a(true); provider.setOAuth10a(true);
@Override public OAuthProvider getProvider() throws ConnectionException { OAuthProvider provider = null; provider = new DefaultOAuthProvider(getApiUrl(ApiRoutineEnum.OAUTH_REQUEST_TOKEN), getApiUrl(ApiRoutineEnum.OAUTH_ACCESS_TOKEN), getApiUrl(ApiRoutineEnum.OAUTH_AUTHORIZE)); provider.setOAuth10a(true); return provider; }
provider.setOAuth10a(true); String signedAuthorizationUrl;
mProvider.setOAuth10a(true);
/** * Initializes client after a successful verification. * * @param verificationToken token for temporary access to the IS24-Webservice during verification * @param verificationSecret secret for temporary access to the IS24-Webservice during verification * @param verificationCode verification code, that was received after the verification was finished * @return {@link Authorization} object, that contains the access credentials for * future use * @throws OAuthException if initialization of the authorization failed */ public final Authorization authorizeAfterVerification(String verificationToken, String verificationSecret, String verificationCode) throws OAuthException { this.oAuthConsumer = buildOAuthConsumer(this.consumerToken, this.consumerSecret); this.oAuthConsumer.setTokenWithSecret(verificationToken, verificationSecret); this.oAuthProvider = buildOAuthProvider(apiBaseUrl); this.oAuthProvider.setOAuth10a(true); //LOGGER.debug( "Fetching access token..." ); this.oAuthProvider.retrieveAccessToken(this.oAuthConsumer, verificationCode); //String accessToken = this.oAuthConsumer.getToken(); //String accessTokenSecret = this.oAuthConsumer.getTokenSecret(); //LOGGER.debug( "Access token: " + accessToken ); //LOGGER.debug( "Token secret: " + accessTokenSecret ); return new Authorization(this.oAuthConsumer.getToken(), this.oAuthConsumer.getTokenSecret()); }
accessTokenUrl != null ? accessTokenUrl : adapter.getAccessTokenUrl(), authorizationUrl != null ? authorizationUrl : adapter.getAuthorizationUrl()); provider.setOAuth10a(true);