Examples of OAuth2Parameters


Examples of com.eviware.soapui.impl.rest.actions.oauth.OAuth2Parameters

                }
            }
            if (!errorsFound) {
                OAuth2TokenExtractor extractor = getExtractor();
                extractor.addBrowserListener(new JavaScriptErrorReporter(profile.getAutomationJavaScripts()));
                OAuth2Parameters parameters = new OAuth2Parameters(profile);
                try {
                    extractor.extractAccessToken(parameters);
                } catch (Exception ignore) {

                }
View Full Code Here

Examples of org.encuestame.oauth2.support.OAuth2Parameters

            @Value("${google.api.key}") String keyId,
            @Value("${google.accesToken}") String accessTokenUrl,
            @Value("${google.authorizeURl}") String authorizeUrl,
            @Value("${google.client.secret}") String clientSecret,
            @Value("${google.client.id}") String clientId) {
       super(new OAuth2Parameters(clientId, clientSecret, accessTokenUrl,
                 authorizeUrl, SocialProvider.GOOGLE_BUZZ, clientId));
    }
View Full Code Here

Examples of org.encuestame.oauth2.support.OAuth2Parameters

            final String authorizeUrl,
            final SocialProvider socialProvider) {
        this.clientId = clientId;
        this.appId = appId;
        this.clientSecret = clientSecret;
        this.auth2RequestProvider = new OAuth2RequestFlow(new OAuth2Parameters(clientId, clientSecret, accessTokenUrl, authorizeUrl, socialProvider, appId));
    }
View Full Code Here

Examples of org.encuestame.oauth2.support.OAuth2Parameters

        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"),
                        EnMePlaceHolderConfigurer.getProperty("facebook.oauth.authorize"),
                        SocialProvider.FACEBOOK,
View Full Code Here

Examples of org.springframework.social.oauth2.OAuth2Parameters

  }

  private String buildOAuth2Url(OAuth2ConnectionFactory<?> connectionFactory, NativeWebRequest request, MultiValueMap<String, String> additionalParameters) {
    OAuth2Operations oauthOperations = connectionFactory.getOAuthOperations();
    String defaultScope = connectionFactory.getScope();
    OAuth2Parameters parameters = getOAuth2Parameters(request, defaultScope, additionalParameters);
    String state = connectionFactory.generateState();
    parameters.add("state", state);
    sessionStrategy.setAttribute(request, OAUTH2_STATE_ATTRIBUTE, state);
    if (useAuthenticateUrl) {
      return oauthOperations.buildAuthenticateUrl(parameters);
    } else {
      return oauthOperations.buildAuthorizeUrl(parameters);
View Full Code Here

Examples of org.springframework.social.oauth2.OAuth2Parameters

      return oauthOperations.buildAuthorizeUrl(parameters);
    }
  }

  private OAuth2Parameters getOAuth2Parameters(NativeWebRequest request, String defaultScope, MultiValueMap<String, String> additionalParameters) {
    OAuth2Parameters parameters = new OAuth2Parameters(additionalParameters);
    parameters.putAll(getRequestParameters(request, "scope"));
    parameters.setRedirectUri(callbackUrl(request));
    String scope = request.getParameter("scope");
    if (scope != null) {
      parameters.setScope(scope);
    } else if (defaultScope != null) {
      parameters.setScope(defaultScope);
    }
    return parameters;
  }
View Full Code Here

Examples of org.springframework.social.oauth2.OAuth2Parameters

  public static OAuth2Parameters oAuth2Parameters(final String redirectUri, final String scope, final String state) {
    return Matchers.argThat(new ArgumentMatcher<OAuth2Parameters>() {

      public boolean matches(Object item) {
        if (item instanceof OAuth2Parameters) {
          OAuth2Parameters params = (OAuth2Parameters) item;
          return eq(state, params.getState()) && eq(scope, params.getScope())
              && eq(redirectUri, params.getRedirectUri());
        }
        return false;
      }

    });
View Full Code Here

Examples of org.springframework.social.oauth2.OAuth2Parameters

  }

  public SocialAuthenticationToken getAuthToken(HttpServletRequest request, HttpServletResponse response) throws SocialAuthenticationRedirectException {
    String code = request.getParameter("code");
    if (!StringUtils.hasText(code)) {
      OAuth2Parameters params =  new OAuth2Parameters();
      params.setRedirectUri(buildReturnToUrl(request));
      setScope(request, params);
      params.add("state", connectionFactory.generateState()); // TODO: Verify the state value after callback
      throw new SocialAuthenticationRedirectException(getConnectionFactory().getOAuthOperations().buildAuthenticateUrl(params));
    } else if (StringUtils.hasText(code)) {
      try {
        String returnToUrl = buildReturnToUrl(request);
        AccessGrant accessGrant = getConnectionFactory().getOAuthOperations().exchangeForAccess(code, returnToUrl, null);
View Full Code Here

Examples of org.springframework.social.oauth2.OAuth2Parameters

    private static void authenticate()
        throws MalformedURLException
    {
        connectionFactory = new AlfrescoConnectionFactory(CONSUMER_KEY, CONSUMER_SECRET);

        OAuth2Parameters parameters = new OAuth2Parameters();
        parameters.setRedirectUri(REDIRECT_URI);
        parameters.setScope(Alfresco.DEFAULT_SCOPE);
        parameters.setState(STATE);

        authUrlObject = new AuthUrl(connectionFactory.getOAuthOperations().buildAuthenticateUrl(GrantType.AUTHORIZATION_CODE, parameters));
    }
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.