Examples of Oauth


Examples of com.alu.e3.prov.restapi.model.OAuth

    return b;
  }

  private static OAuth fromDataModelToOAuth(AuthDetail authDetail) {
    if (authDetail==null) throw new IllegalArgumentException("authDetail must not be null");
    OAuth b = new OAuth();
    b.setClientId(authDetail.getClientId());
    b.setClientSecret(authDetail.getClientSecret());
    return b;
  }
View Full Code Here

Examples of com.fitbit.api.client.http.OAuth

      return sb.toString();
    }


    public static String generateSignature(String data, String secret) {
      OAuth oauth = new OAuth(null, secret);
      return oauth.generateSignature(data);
    }
View Full Code Here

Examples of com.k42b3.neodym.oauth.Oauth

      {
        throw new Exception("Could not find access service");
      }

      OauthProvider provider = new OauthProvider(request.getUri(), authorization.getUri(), access.getUri(), Configuration.getInstance().getConsumerKey(), Configuration.getInstance().getConsumerSecret());
      oauth = new Oauth(http, provider);
    }
    catch(Exception e)
    {
      Zubat.handleException(e);
    }
View Full Code Here

Examples of com.k42b3.neodym.oauth.Oauth

    String requestUrl = availableServices.getItem("http://oauth.net/core/1.0/endpoint/request").getUri();
    String authorizationUrl = availableServices.getItem("http://oauth.net/core/1.0/endpoint/authorize").getUri();
    String accessUrl = availableServices.getItem("http://oauth.net/core/1.0/endpoint/access").getUri();

    OauthProvider provider = new OauthProvider(requestUrl, authorizationUrl, accessUrl, Configuration.getInstance().getConsumerKey(), Configuration.getInstance().getConsumerSecret());
    Oauth oauth = new Oauth(http, provider);

    if(!Configuration.getInstance().getToken().isEmpty() && !Configuration.getInstance().getTokenSecret().isEmpty())
    {
      oauth.auth(Configuration.getInstance().getToken(), Configuration.getInstance().getTokenSecret());
    }
    else
    {
      throw new Exception("No token set use --auth to obtain a token and token secret");
    }
View Full Code Here

Examples of com.wordnik.swagger.model.OAuth

        List<GrantType> gtypes = new ArrayList<GrantType>();
        for (JGrantType jgt : grantTypes) {
            gtypes.add(jgt.getAuthorization_code().toSwaggerModel());
            gtypes.add(jgt.getImplicit().toSwaggerModel());
        }
        return new OAuth(
                new ListConverter<JAuthorizationScope, AuthorizationScope>(scopes).convert(),
                Utils.toScalaImmutableList(gtypes));
    }
View Full Code Here

Examples of org.agorava.api.oauth.OAuth

    public void processOauthService(@Observes ProcessAnnotatedType<? extends OAuthService> pat) {
        pat.veto();
        AnnotatedType<? extends OAuthService> at = pat.getAnnotatedType();
        Class<? extends OAuthService> clazz = (Class<? extends OAuthService>) at.getBaseType();
        OAuth qualOauth = at.getAnnotation(OAuth.class);
        if (qualOauth != null)
            version2ServiceClass.put(qualOauth.value(), clazz);
    }
View Full Code Here

Examples of play.libs.OAuth

  public static void oauthTwitter() {

    // first time the request comes here
    // the user has just pushed the "sign in with twitter button"
    if (!OAuth.isVerifierResponse()) {
      final OAuth twitter = OAuth.service(TWITTER);
      final OAuth.Response response = twitter.retrieveRequestToken();
      if (response.error==null) {
        final User user = new User();
        user.token = response.token;
        user.secret = response.secret;
        user.save();
        session.put("userId", user.id);
        redirect(twitter.redirectUrl(response.token));
      } else {
              Logger.error("Error contacting twitter: " + response.error);
              login();
          }
     
View Full Code Here

Examples of play.libs.OAuth

            } else {
                Logger.error("Error connecting to twitter: " + oauthResponse.error);
            }
            index();
        }
        OAuth twitt = OAuth.service(TWITTER);
        OAuth.Response oauthResponse = twitt.retrieveRequestToken();
        if (oauthResponse.error == null) {
            // We received the unauthorized tokens in the OAuth object - store it before we proceed
            user.token = oauthResponse.token;
            user.secret = oauthResponse.secret;
            user.save();
            redirect(twitt.redirectUrl(oauthResponse.token));
        } else {
            Logger.error("Error connecting to twitter: " + oauthResponse.error);
            index();
        }
    }
View Full Code Here

Examples of play.libs.OAuth

    }

    public static void auth() throws Exception {
        flash.keep(REDIRECT_URL);
        ServiceInfo serviceInfo = Dropbox.OAUTH;
        OAuth oauth = OAuth.service(serviceInfo);
        OAuth.Response oauthResponse = oauth.retrieveRequestToken();
        if (oauthResponse.error == null) {
            Logger.info("Redirecting to Dropbox for auth.");
            session.put(SessionKeys.TOKEN, oauthResponse.token);
            session.put(SessionKeys.SECRET, oauthResponse.secret);
            redirect(oauth.redirectUrl(oauthResponse.token) +
                    "&oauth_callback=" +
                    URLEncoder.encode(request.getBase() + "/auth-cb", "UTF-8"));
        } else {
            Logger.error("Error connecting to Dropbox: " + oauthResponse.error);
            error("Error connecting to Dropbox.");
View Full Code Here

Examples of play.libs.oauth.OAuth

    final String accessTokenURL = c.getString(SettingKeys.ACCESS_TOKEN_URL);
    final String authorizationURL = c
        .getString(SettingKeys.AUTHORIZATION_URL);
    final ServiceInfo info = new ServiceInfo(requestTokenURL,
        accessTokenURL, authorizationURL, key);
    final OAuth service = new OAuth(info, true);

        checkError(request);

        if (uri.contains(Constants.OAUTH_VERIFIER)) {

      final RequestToken rtoken = (RequestToken) PlayAuthenticate
          .removeFromCache(context.session(), CACHE_TOKEN);
      final String verifier = request.getQueryString(Constants.OAUTH_VERIFIER);
      try {
        final RequestToken response = service
            .retrieveAccessToken(rtoken, verifier);
        final I i = buildInfo(response);
        return transform(i);
      } catch (RuntimeException ex) {
        throw new AuthException(ex
            .getLocalizedMessage());
      }
    } else {

      final String callbackURL = getRedirectUrl(request);

      try {
        final RequestToken response = service
            .retrieveRequestToken(callbackURL);
        // All good, we have the request token
        final String token = response.token;
        final String redirectUrl = service.redirectUrl(token);

        PlayAuthenticate.storeInCache(context.session(), CACHE_TOKEN,
            new SerializableRequestToken(response));
        return redirectUrl;
      } catch (RuntimeException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.