Package org.encuestame.utils.oauth

Examples of org.encuestame.utils.oauth.AccessGrant


        requestParameters.set("redirect_uri", redirectUri);
        requestParameters.set("grant_type", "authorization_code");
        log.debug("requestParameters "+requestParameters.toString());
        Map result = getRestTemplate().postForObject(accessTokenUrl, requestParameters, Map.class);
        log.debug("Access Grant "+result.toString());
        return new AccessGrant(valueOf(result.get("access_token")), valueOf(result.get("refresh_token")));
    }
View Full Code Here


        requestParameters.set("grant_type", "refresh_token");
        log.debug("requestParameters "+requestParameters.toString());
        @SuppressWarnings("unchecked")
        Map<String, ?> result = getRestTemplate().postForObject(accessTokenUrl, requestParameters, Map.class);
        log.debug(result);
        return new AccessGrant(valueOf(result.get("access_token")), refreshToken);
    }
View Full Code Here

    @RequestMapping(value="/social/back/google", method=RequestMethod.GET, params="code")
    public String oauth2Callback(
            @RequestParam("code") String code,
            HttpServletRequest httpRequest,
        WebRequest request) throws Exception {
            final AccessGrant accessGrant = auth2RequestProvider.getAccessGrant(code, httpRequest);
            log.debug(accessGrant.getAccessToken());
            log.debug(accessGrant.getRefreshToken());
            checkOAuth2SocialAccount(SocialProvider.GOOGLE_BUZZ, accessGrant);
            return this.redirect+"#provider="+SocialProvider.GOOGLE_BUZZ.toString().toLowerCase()+"&refresh=true&successful=true";
    }
View Full Code Here

    public String oauth2Callback(
            @RequestParam(value = "code", required = true) String code,
            HttpServletRequest httpRequest,
            WebRequest request) throws Exception {
        try {
             final AccessGrant accessGrant = auth2RequestProvider.getAccessGrant(code, httpRequest);
             log.debug(accessGrant.getAccessToken());
             log.debug(accessGrant.getRefreshToken());
             checkOAuth2SocialAccount(SocialProvider.FACEBOOK, accessGrant);
        } catch (EnMeOAuthSecurityException e1) {
            RequestSessionMap.setErrorMessage(getMessage("errorOauth", httpRequest, null));
        } catch (EnMeExistPreviousConnectionException e1) {
            RequestSessionMap.setErrorMessage(getMessage("social.repeated.account", httpRequest, null));
View Full Code Here

           HttpServletRequest httpRequest,
           WebRequest request) {
        try {
                  log.debug("httpRequest "+httpRequest.getRequestURI());
                  log.debug("httpRequest "+httpRequest.getQueryString());
               final AccessGrant accessGrant = auth2RequestProvider.getAccessGrant(code, httpRequest);
               if (log.isDebugEnabled()) {
                   log.debug(accessGrant.getAccessToken());
                   log.debug(accessGrant.getRefreshToken());
               }
            String friendsUrl = "redirect:/user/signin/friends";
            final SocialProvider providerBack;
            if ("google".equals(provider) && state != null) {
                providerBack = SocialProvider.getProvider(state);
View Full Code Here

TOP

Related Classes of org.encuestame.utils.oauth.AccessGrant

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.