Package com.google.gdata.client.authn.oauth

Examples of com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer


     * @return list of names of a user's public and private calendars.
     */
    public List<String> getCalendarNames(String accessToken, String accessTokenSecret) throws Exception {
        CalendarService calendarService = new CalendarService("apache-camel-2.3");
        OAuthParameters params = getOAuthParams(accessToken, accessTokenSecret);
        calendarService.setOAuthCredentials(params, new OAuthHmacSha1Signer());
        URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/");
        CalendarFeed resultFeed = calendarService.getFeed(feedUrl, CalendarFeed.class);

        ArrayList<String> result = new ArrayList<String>();
        for (int i = 0; i < resultFeed.getEntries().size(); i++) {
View Full Code Here


     * @return list of names of a user's public and private calendars.
     */
    public List<String> getCalendarNames(String accessToken, String accessTokenSecret) throws Exception {
        CalendarService calendarService = new CalendarService("apache-camel-2.3");
        OAuthParameters params = getOAuthParams(accessToken, accessTokenSecret);
        calendarService.setOAuthCredentials(params, new OAuthHmacSha1Signer());
        URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/");
        CalendarFeed resultFeed = calendarService.getFeed(feedUrl, CalendarFeed.class);

        List<String> result = new ArrayList<String>();
        for (int i = 0; i < resultFeed.getEntries().size(); i++) {
View Full Code Here

     * on this endpoint's properties.
     */
    OAuthHelper newOAuthHelper() throws Exception {
        OAuthSigner signer = null;
        if (getKeyLoader() == null) {
            signer = new OAuthHmacSha1Signer();
        } else {
            signer = new OAuthRsaSha1Signer(getPrivateKey());
        }
        return new GoogleOAuthHelper(signer);
    }
View Full Code Here

      case RSA:
        signer = new OAuthRsaSha1Signer(variables.getSignatureKey());
        break;
      case HMAC:
        oauthParameters.setOAuthConsumerSecret(variables.getSignatureKey());
        signer = new OAuthHmacSha1Signer();
        break;
      default:
        throw new IllegalArgumentException("Invalid Signature Method");
    }
View Full Code Here

    // Initialize the OAuth Signer.  2-Legged OAuth must use HMAC-SHA1, which
    // uses the OAuth Consumer Secret to sign the request.  The OAuth Consumer
    // Secret can be obtained at https://www.google.com/accounts/ManageDomains.
    oauthParameters.setOAuthConsumerSecret(variables.getSignatureKey());
    OAuthSigner signer = new OAuthHmacSha1Signer();

    // Finally create a new GoogleOAuthHelperObject.  This is the object you
    // will use for all OAuth-related interaction.
    GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(signer);
View Full Code Here

   * @param getNew if true, new OAuth helper will be returned, existing otherwise
   * @return OAuth Helper with specified URLs for request Token, Access Token, User auth URL
   */
  private GoogleOAuthHelper getOAuthHelper(boolean getNew){
    if (getNew){
        oauthHelper = new GoogleOAuthHelper(new OAuthHmacSha1Signer());
        try {
          URL serverURLObject = new URL(serverURL);
          URL serverURLSecured = new URL("https", serverURLObject.getHost(), serverURLObject.getPort(), serverURLObject.getFile());
          String stringServURL = serverURLSecured.toString();
          if(!stringServURL.endsWith("/")){
View Full Code Here

TOP

Related Classes of com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.