Ignore:
Timestamp:
2015-12-31T03:24:56+01:00 (9 years ago)
Author:
Don-vip
Message:

OAuth: add robustness, basic unit test, code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    r9172 r9227  
    5050        private String token;
    5151        private String userName;
    52     }
    53 
    54     /**
    55      * Creates a new authorisation client with default OAuth parameters
    56      *
    57      */
    58     public OsmOAuthAuthorizationClient() {
    59         oauthProviderParameters = OAuthParameters.createDefault(Main.pref.get("osm-server.url"));
    60         consumer = oauthProviderParameters.buildConsumer();
    61         provider = oauthProviderParameters.buildProvider(consumer);
    6252    }
    6353
     
    241231    }
    242232
    243     protected String buildPostRequest(Map<String, String> parameters) throws OsmOAuthAuthorizationException {
     233    protected static String buildPostRequest(Map<String, String> parameters) {
    244234        StringBuilder sb = new StringBuilder(32);
    245235
     
    322312     * Submits a request to the OSM website for a OAuth form. The OSM website replies a session token in
    323313     * a hidden parameter.
     314     * @param sessionId session id
     315     * @param requestToken request token
    324316     *
    325317     * @throws OsmOAuthAuthorizationException if something went wrong
Note: See TracChangeset for help on using the changeset viewer.