Package org.openstreetmap.josm.data.oauth

Examples of org.openstreetmap.josm.data.oauth.OAuthParameters


     * @param parameters the OAuth parameters. Must not be null.
     * @throws IllegalArgumentException if parameters is null
     */
    public OsmOAuthAuthorizationClient(OAuthParameters parameters) throws IllegalArgumentException {
        CheckParameterUtil.ensureParameterNotNull(parameters, "parameters");
        oauthProviderParameters = new OAuthParameters(parameters);
        consumer = oauthProviderParameters.buildConsumer();
        provider = oauthProviderParameters.buildProvider(consumer);
    }
View Full Code Here


     * @throws IllegalArgumentException if parameters is null
     * @throws IllegalArgumentException if requestToken is null
     */
    public OsmOAuthAuthorizationClient(OAuthParameters parameters, OAuthToken requestToken) throws IllegalArgumentException {
        CheckParameterUtil.ensureParameterNotNull(parameters, "parameters");
        oauthProviderParameters = new OAuthParameters(parameters);
        consumer = oauthProviderParameters.buildConsumer();
        provider = oauthProviderParameters.buildProvider(consumer);
        consumer.setTokenWithSecret(requestToken.getKey(), requestToken.getSecret());
    }
View Full Code Here

        cbUseDefaults.addItemListener(ilUseDefault = new UseDefaultItemListener());
    }

    protected boolean hasCustomSettings() {
        OAuthParameters params = OAuthParameters.createDefault(apiUrl);
        return
           ! tfConsumerKey.getText().equals(params.getConsumerKey())
        || ! tfConsumerSecret.getText().equals(params.getConsumerSecret())
        || ! tfRequestTokenURL.getText().equals(params.getRequestTokenUrl())
        || ! tfAccessTokenURL.getText().equals(params.getAccessTokenUrl())
        || ! tfAuthoriseURL.getText().equals(params.getAuthoriseUrl());
    }
View Full Code Here

        return ret == 0; // OK button clicked
    }

    protected void resetToDefaultSettings() {
        cbUseDefaults.setSelected(true);
        OAuthParameters params = OAuthParameters.createDefault(apiUrl);
        tfConsumerKey.setText(params.getConsumerKey());
        tfConsumerSecret.setText(params.getConsumerSecret());
        tfRequestTokenURL.setText(params.getRequestTokenUrl());
        tfAccessTokenURL.setText(params.getAccessTokenUrl());
        tfAuthoriseURL.setText(params.getAuthoriseUrl());

        setChildComponentsEnabled(false);
    }
View Full Code Here

     * @return the OAuth parameters
     */
    public OAuthParameters getAdvancedParameters() {
        if (cbUseDefaults.isSelected())
            return OAuthParameters.createDefault(apiUrl);
        OAuthParameters parameters = new OAuthParameters();
        parameters.setConsumerKey(tfConsumerKey.getText());
        parameters.setConsumerSecret(tfConsumerSecret.getText());
        parameters.setRequestTokenUrl(tfRequestTokenURL.getText());
        parameters.setAccessTokenUrl(tfAccessTokenURL.getText());
        parameters.setAuthoriseUrl(tfAuthoriseURL.getText());
        return parameters;
    }
View Full Code Here

        }

        @Override
        public void actionPerformed(ActionEvent evt) {
            OAuthToken token = OAuthAccessTokenHolder.getInstance().getAccessToken();
            OAuthParameters parameters = OAuthParameters.createFromPreferences(Main.pref);
            TestAccessTokenTask task = new TestAccessTokenTask(
                    OAuthAuthenticationPreferencesPanel.this,
                    apiUrl,
                    parameters,
                    token
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.oauth.OAuthParameters

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.