public OAuth1RequestToken exchangeAuthToken ( String authToken ) throws FlickrException { // Use TreeMap so keys are automatically sorted alphabetically Map < String , String > parameters = new TreeMap < String , String > ( ) ; parameters . put ( "method" , METHOD_EXCHANGE_TOKEN ) ; parameters . put ( Flickr . API_KEY , apiKey ) ; // This method call must be signed using Flickr (not OAuth) style signing parameters . put ( "api_sig" , getSignature ( sharedSecret , parameters ) ) ; Response response = transportAPI . getNonOAuth ( transportAPI . getPath ( ) , parameters ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } OAuth1RequestToken accessToken = constructToken ( response ) ; return accessToken ; }
Exchange an auth token from the old Authentication API to an OAuth access token .