Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.SocialAuthConfigurationException


        LOG.debug("Call to fetch Access Token");
        accessToken = oauth.getAccessToken(
            endpoints.get(Constants.OAUTH_ACCESS_TOKEN_URL),
            requestToken);
        if (accessToken == null) {
          throw new SocialAuthConfigurationException(
              "Application keys may not be correct. "
                  + "The server running the application should be same that was registered to get the keys.");
        }
      }
      for (Map.Entry<String, String> entry : requestParams.entrySet()) {
View Full Code Here


        throw new SocialAuthException(id
            + " is not a provider or valid OpenId URL");
      }
    }
    if (config == null) {
      throw new SocialAuthConfigurationException("Configuration of " + id
          + " provider is not found");
    }

    if (config.get_consumerSecret().length() <= 0) {
      throw new SocialAuthConfigurationException(id
          + " consumer_secret value is null");
    }
    if (config.get_consumerKey().length() <= 0) {
      throw new SocialAuthConfigurationException(id
          + " consumer_key value is null");
    }
    return config;
  }
View Full Code Here

   */
  public void setSocialAuthConfig(final SocialAuthConfig socialAuthConfig)
      throws Exception {
    LOG.debug("Setting socialauth config");
    if (socialAuthConfig == null) {
      throw new SocialAuthConfigurationException(
          "SocialAuthConfig is null");
    } else {
      if (!socialAuthConfig.isConfigSetup()) {
        throw new SocialAuthConfigurationException(
            "Configuration is not provided. Call load() method of SocialAuthConfig class to set up configuration");
      }
    }
    this.socialAuthConfig = socialAuthConfig;
  }
View Full Code Here

  private String getAuthURL(final String id, final String successUrl,
      final Permission permission) throws Exception {
    String url;
    providerId = id;
    if (socialAuthConfig == null) {
      throw new SocialAuthConfigurationException(
          "SocialAuth configuration is null.");
    }
    if (providersMap.get(id) != null) {
      url = successUrl;
      authProvider = providersMap.get(id);
View Full Code Here

   */
  public AccessGrant createAccessGrant(final String providerId,
      final String authCode, final String redirectURL) throws Exception {
    this.providerId = providerId;
    if (socialAuthConfig == null) {
      throw new SocialAuthConfigurationException(
          "SocialAuth configuration is null.");
    }
    getAuthenticationUrl(providerId, redirectURL);
    if (providersMap.get(providerId) != null) {
      authProvider = providersMap.get(providerId);
View Full Code Here

  public AccessGrant createAccessGrant(final String providerId,
      final Map<String, String> params, final String redirectURL)
      throws Exception {
    this.providerId = providerId;
    if (socialAuthConfig == null) {
      throw new SocialAuthConfigurationException(
          "SocialAuth configuration is null.");
    }
   
    if (providersMap.get(providerId) != null) {
      authProvider = providersMap.get(providerId);
View Full Code Here

      LOG.warn(obj.getName() + " does not implement a constructor "
          + obj.getName() + "(Poperties props)");
      try {
        provider = (AuthProvider) obj.newInstance();
      } catch (Exception e) {
        throw new SocialAuthConfigurationException(e);
      }
    } catch (Exception e) {
      throw new SocialAuthConfigurationException(e);
    }
    try {
      provider.registerPlugins();
    } catch (Exception e) {
      throw new SocialAuthConfigurationException(e);
    }

    return provider;
  }
View Full Code Here

    } catch (NoSuchMethodException me) {
      LOG.warn(obj.getName() + " does not implement a constructor "
          + obj.getName() + "(OAuthConfig providerConfig)");
      provider = (AuthProvider) obj.newInstance();
    } catch (Exception e) {
      throw new SocialAuthConfigurationException(e);
    }
    return provider;
  }
View Full Code Here

    if (response.getStatus() == 200) {
      token = new AccessGrant();
      parse(response.getInputStream(), token);
    } else {
      LOG.debug("Error while fetching Request Token");
      throw new SocialAuthConfigurationException(
          "Application keys are not correct. "
              + "The server running the application should be same that was registered to get the keys.");
    }
    return token;
  }
View Full Code Here

      } catch (Exception exc) {
        throw new SocialAuthException("Failed to parse response", exc);
      }
    }
    if (result == null || result.length() == 0) {
      throw new SocialAuthConfigurationException(
          "Problem in getting Access Token. Application key or Secret key may be wrong."
              + "The server running the application should be same that was registered to get the keys.");
    }

    JSONObject resp = new JSONObject(result);
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.exception.SocialAuthConfigurationException

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.