Package org.encuestame.utils.social

Examples of org.encuestame.utils.social.SocialProvider


            HttpServletRequest httpRequest,
            WebRequest request) throws Exception {
        log.error("ERROR error_code" + error_code);
        log.error("ERROR error_msg" + error_msg);
        log.error("ERROR socialProvider" + socialProvider);
        final SocialProvider soProvider = SocialProvider.getProvider(socialProvider);
        return this.redirect+"#provider=" + soProvider.toString().toLowerCase() + "&refresh=true&successful=false";
    }
View Full Code Here


        @PathVariable String provider,
        WebRequest request,
        @RequestParam(required = false) String scope,
        HttpServletRequest httpRequest){
        final StringBuilder url = new StringBuilder();
        final SocialProvider providerEnum = SocialProvider.getProvider(provider);
        log.debug("PROVIDER "+providerEnum);
        if (providerEnum == null) {
            url.append("404");
        } else {
            if (SocialProvider.GOOGLE_BUZZ.equals(providerEnum)) {
               OAuth2Parameters auth2Parameters = new OAuth2Parameters(
                        EnMePlaceHolderConfigurer.getProperty("google.register.client.id"),
                        EnMePlaceHolderConfigurer.getProperty("google.register.client.secret"),
                        EnMePlaceHolderConfigurer.getProperty("google.accesToken"),
                        EnMePlaceHolderConfigurer.getProperty("google.authorizeURl"),
                        SocialProvider.GOOGLE_BUZZ,
                        EnMePlaceHolderConfigurer.getProperty("google.register.client.id"));
                auth2RequestProvider  =  new OAuth2RequestFlow(auth2Parameters);
                auth2RequestProvider.DEFAULT_CALLBACK_PATH = POST_REGISTER_REDIRECT;
                url.append(auth2RequestProvider.buildOAuth2AuthorizeUrl(
                        EnMePlaceHolderConfigurer.getProperty("google.buzz.scope"), httpRequest, false));
                url.append("&state=");
                url.append(providerEnum.toString());
            } else if (SocialProvider.FACEBOOK.equals(providerEnum)) {
                OAuth2Parameters auth2Parameters = new OAuth2Parameters(
                        EnMePlaceHolderConfigurer.getProperty("facebook.api.key"),
                        EnMePlaceHolderConfigurer.getProperty("facebook.api.secret"),
                        EnMePlaceHolderConfigurer.getProperty("facebook.oauth.accesToken"),
View Full Code Here

               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);
            } else {
                providerBack = SocialProvider.getProvider(provider);
            }
            if (providerBack == null) {
                throw new EnMeOAuthSecurityException("provider ["+provider+"] not valid");
            }
            if (providerBack.equals(SocialProvider.GOOGLE_BUZZ)) {
                friendsUrl = getConnectOperations().connectSignInAccount(
                        new GoogleBuzzSignInSocialService(accessGrant,
                                getConnectOperations()));
            } else if (SocialProvider.getProvider(provider).equals(
                    SocialProvider.FACEBOOK)) {
View Full Code Here

    /**
     * Test social provider.
     */
    @Test
    public void testSocialProvider(){
        final SocialProvider twitterProvider = SocialProvider.getProvider("TWITTER");
        assertEquals("Should be equals", "TWITTER", twitterProvider.toString());

        final SocialProvider facebookProvider = SocialProvider.getProvider("FACEBOOK");
        assertEquals("Should be equals", "FACEBOOK", facebookProvider.toString());

        final SocialProvider identicaProvider = SocialProvider.getProvider("IDENTICA");
        assertEquals("Should be equals", "IDENTICA", identicaProvider.toString());

        final SocialProvider linkedinProvider = SocialProvider.getProvider("LINKEDIN");
        assertEquals("Should be equals", "LINKEDIN", linkedinProvider.toString());

        final SocialProvider mySpaceProvider = SocialProvider.getProvider("YAHOO");
        assertEquals("Should be equals", "YAHOO", mySpaceProvider.toString());

        final SocialProvider googleBuzzProvider = SocialProvider.getProvider("GOOGLE_BUZZ");
        assertEquals("Should be equals", "GOOGLEBUZZ", googleBuzzProvider.toString());

        final SocialProvider yahooProvider = SocialProvider.getProvider("MYSPACE");
        assertEquals("Should be equals", "MYSPACE", yahooProvider.toString());
    }
View Full Code Here

     * @return
     */
    public static final List<SocialProvider> convertSocialProviderStringToProvider(
            final List<String> socialProviders) {
        final List<SocialProvider> socialNetworksProviders = new ArrayList<SocialProvider>();
        SocialProvider socialNetworkProv;
        for (String provider : socialProviders) {
            socialNetworkProv = SocialProvider.getProvider(provider);
            if (socialNetworkProv != null) {
                socialNetworksProviders.add(socialNetworkProv);
            }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.social.SocialProvider

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.