Package play.libs.oauth

Examples of play.libs.oauth.OAuth$WSRequestAdapter


    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

Related Classes of play.libs.oauth.OAuth$WSRequestAdapter

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.