public OAuthServiceDecorator(OAuthService oAuthService, String type) { super(); this.oAuthService = oAuthService; this.oAuthType = type; this.authorizationUrl = oAuthService.getAuthorizationUrl(null); }
@Override protected WebView doInBackground(Void... params) { System.out.println("001 OauthStart doInBackground"); oas_linkedin = new ServiceBuilder().provider(LinkedInApi.class) .apiKey(APIKEY).apiSecret(APISECRET) .callback(OAUTH_CALLBACK_URL).build(); requestToken = oas_linkedin.getRequestToken(); authURL = oas_linkedin.getAuthorizationUrl(requestToken); return (WebView) findViewById(R.id.web_view); }
@Override protected WebView doInBackground(Void... params) { System.out.println("001 OauthStart doInBackground"); oas_linkedin = new ServiceBuilder().provider(LinkedInApi.class) .apiKey(APIKEY).apiSecret(APISECRET) .callback(OAUTH_CALLBACK_URL).build(); requestToken = oas_linkedin.getRequestToken(); authURL = oas_linkedin.getAuthorizationUrl(requestToken); return (WebView) findViewById(R.id.web_view); }
public String createAuthorizationUrl(Token requestToken) { String url = mOAuthService.getAuthorizationUrl(requestToken); if (mSupportAppLinkedNotebooks) { url += "&supportLinkedSandbox=true"; } return url; }
@Override public String getAuthorizationUrl(Token requestToken) { return wrapped.getAuthorizationUrl(requestToken); }
private static final Token EMPTY_TOKEN = null; OAuthService service = new ServiceBuilder() .provider(FacebookApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback("http://www.example.com/oauth_callback/") .build(); String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);
public String getAuthorizationUrl(final UserSession session) { init(); // no requestToken for OAuth 2.0 -> no need to save it in the user session final String authorizationUrl = this.service.getAuthorizationUrl(null); logger.debug("authorizationUrl : {}", authorizationUrl); return authorizationUrl; }
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); }
@Override public String getAuthorizationUrl(OAuthToken tok) { return getService().getAuthorizationUrl(extractToken(tok)); }
public String getAuthorizationUrl(final UserSession session) { init(); final Token requestToken = this.service.getRequestToken(); logger.debug("requestToken : {}", requestToken); // save requestToken in user session session.setAttribute(getRequestTokenSessionAttributeName(), requestToken); final String authorizationUrl = this.service.getAuthorizationUrl(requestToken); logger.debug("authorizationUrl : {}", authorizationUrl); return authorizationUrl; }
public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Paste the consumerKey here"); System.out.print(">>"); String apiKey = in.nextLine(); System.out.println("Paste the consumerSecret here"); System.out.print(">>"); String apiSecret = in.nextLine(); OAuthService service = new ServiceBuilder() .provider(YammerApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .build(); String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN); System.out .println("Go and authorize your app here (eg. in a web browser):"); System.out.println(authorizationUrl); System.out.println("... and paste the authorization code here"); System.out.print(">>"); Verifier verifier = new Verifier(in.nextLine()); System.out.println(); Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier); System.out.println("Your Access Token is: " + accessToken); System.out.println(); in.close(); }
String authURL = service.getAuthorizationUrl(requestToken); System.out.println(authURL); BareBonesBrowserLaunch.openURL("www.google.com");
public String getAuthUrl(String state) { OAuthService service = getOAuthService(scopes, state); return service.getAuthorizationUrl(null); }
System.out.println(service.getAuthorizationUrl(requestToken));
System.out.println(service.getAuthorizationUrl(requestToken));
String authorizationUrl = service.getAuthorizationUrl(requestToken); do { String code = JOptionPane.showInputDialog("The token for the account (whatever)" + newline
/** * Get the auth URL, this is step two of authorization. * * @param oAuthRequestToken * the token from a {@link AuthInterface#getRequestToken} call. */ public String getAuthorizationUrl(Token oAuthRequestToken, Permission permission) { OAuthService service = new ServiceBuilder().provider(FlickrApi.class).apiKey(apiKey).apiSecret(sharedSecret).build(); String authorizationUrl = service.getAuthorizationUrl(oAuthRequestToken); return String.format("%s&perms=%s", authorizationUrl, permission.toString()); }
public String getAuthorizationUrl(ResponseType responseType, DisplayType displayType, String state, String callback, ForceLogin forceLogin) { SinaWeibo2Api api = new SinaWeibo2Api(responseType, displayType, forceLogin); api.setState(state); OAuthService service = new ServiceBuilder() .apiKey(clientId) .apiSecret(clientSecret) .callback(callback) .provider(api) .build(); return service.getAuthorizationUrl(null); }
authURL = service.getAuthorizationUrl(requestToken); } catch (OAuthException e) { e.printStackTrace();
aService.getAuthorizationUrl(getRequestToken(aService));