2012-02-13 1 views
0

.. 잘못된 서명 오류가 발생했습니다. 누군가 나를 도울 수 있습니까? = vimeo apis를 사용할 때 303 오류 서명이 잘못되었습니다

자료 문자열 vimeo.oauth.checkAccessToken

vimeo.com/api/rest/v2 방법 : GET & HTTP % 3A? 의 oauth_token 내가 허가

URL 후 얻을 액세스 토큰 % 2F % 2Fvimeo.com % 2Fapi % 2Frest 2Fv2 % & 방법 3Dvimeo.oauth.checkAccessToken % % % 26oauth_consumer_key 3D763ebd960af20c4844be38d388299f62 % 26oauth_nonce % 3D-5,297,335,925,725,406,200% 26oauth_signature_method % 3DHMAC-SHA1 % 26oauth_timestamp % 3D1329134906 % 26oauth_token % 3Da61b496a94ebdaa151f1b757bdd54ad7 % 26oauth_version % 3D1.0

HEADER : OAuth를 oauth_consumer_key = "763ebd960af20c4844be38d388299f62", oauth_nonce = "- 5297335925725406200"oauth_signature = "0xBOoOtHG % 2BoiAImx3no0bUTTFeU % 3D", oauth_signature_method = "HMAC-SHA1", oauth_timestamp = "1329134906"의 oauth_token = "a61b496a94ebdaa151f1b757bdd54ad7"oauth_version = "1.0"

답변

0

여전히 문제가 있는지 알 수 없지만 scribe을 사용해 볼 수 있습니다. 나는 vimeo에 대한 응용 프로그램을 개발하고 Scribe에 크게 의존하여 서명하고 서명했습니다. 다음은 인증 및 서명하고 요청을 보내는 예제입니다.

private static OAuthService service; 
    private static Token accessToken; 
    private static String newline = System.getProperty("line.separator"); 

    public static void main(String[] args) throws Exception { 
    // Replace these with your own api key and secret 

    String apiKey = "YOUR_API_KEY"; //Give your own API Key 
    String apiSecret = "YOUR_API_SECRET"; //Give your own API Secret 
    String vimeoAPIURL = "http://vimeo.com/api/rest/v2"; 
    service = new ServiceBuilder().provider(VimeoApi.class).apiKey(apiKey).apiSecret(apiSecret).build(); 

    OAuthRequest request; 
    Response response; 

    accessToken = new Token("AN_INVALID_TOKEN_WILL", "REQUIRE_GETTING_A_NEW_ONE"); //Copy the new token you get here 

    accessToken = checkToken(vimeoAPIURL, accessToken, service); 
    if (accessToken == null) { 
     return; 
    } 
} 

    /** 
    * Checks the token to make sure it's still valid. If not, it pops up a dialog asking the user to 
    * authenticate. 
    */ 
    private static Token checkToken(String vimeoAPIURL, Token vimeoToken, OAuthService vimeoService) { 
    if (vimeoToken == null) { 
     vimeoToken = getNewToken(vimeoService); 
    } else { 
     OAuthRequest request = new OAuthRequest(Verb.GET, vimeoAPIURL); 
     request.addQuerystringParameter("method", "vimeo.oauth.checkAccessToken"); 
     Response response = signAndSendToVimeo(request, "checkAccessToken", true); 
     if (response.isSuccessful() 
       && (response.getCode() != 200 || response.getBody().contains("<err code=\"302\"") 
       || response.getBody().contains("<err code=\"401\""))) { 
     vimeoToken = getNewToken(vimeoService); 
     } 
    } 
    return vimeoToken; 
    } 

    /** 
    * Gets authorization URL, pops up a dialog asking the user to authenticate with the url and the user 
    * returns the authorization code 
    * 
    * @param service 
    * @return 
    */ 
    private static Token getNewToken(OAuthService service) { 
    // Obtain the Authorization URL 
    Token requestToken = service.getRequestToken(); 
    String authorizationUrl = service.getAuthorizationUrl(requestToken); 
    do { 
     String code = JOptionPane.showInputDialog("The token for the account (whatever)" + newline 
       + "is either not set or is no longer valid." + newline 
       + "Please go to the URL below and authorize this application." + newline 
       + "Paste the code you're given on top of the URL here and click \'OK\'" + newline 
       + "(click the 'x' or input the letter 'q' to cancel." + newline 
       + "If you input an invalid code, I'll keep popping up).", authorizationUrl + "&permission=delete"); 
     if (code == null) { 
     return null; 
     } 
     Verifier verifier = new Verifier(code); 
     // Trade the Request Token and Verfier for the Access Token 
     System.out.println("Trading the Request Token for an Access Token..."); 
     try { 
     Token token = service.getAccessToken(requestToken, verifier); 
     System.out.println(token); //Use this output to copy the token into your code so you don't have to do this over and over. 
     return token; 
     } catch (OAuthException ex) { 
     int choice = JOptionPane.showConfirmDialog(null, "There was an OAuthException" + newline 
       + ex + newline 
       + "Would you like to try again?", "OAuthException", JOptionPane.YES_NO_OPTION); 
     if (choice == JOptionPane.NO_OPTION) { 
      break; 
     } 
     } 
    } while (true); 
    return null; 
    } 

    /** 
    * Signs the request and sends it. Returns the response. 
    * 
    * @param request 
    * @return response 
    */ 
    public static Response signAndSendToVimeo(OAuthRequest request) throws org.scribe.exceptions.OAuthException { 
    service.signRequest(accessToken, request); 
    Response response = request.send(); 
    return response; 
    } 
0

사람들 거의 비슷한 문제가 있습니다.

기본 전화로 작업하고 있었는데 모든 것이 잘 작동했습니다. 하지만 기본은 오직 60 개의 비디오를 쿼리 할 수 ​​있다는 것을 깨달았습니다. 20 페이지 당 비디오. 다음은 기본 페이지 생성을 구현하려고 시도했지만 3 개의 페이지, 즉 30 개의 동영상에 대해서만 작동하는 링크입니다.

http://projects.tk-fn.com/controls/Vimeo/BKBVideoPage-Backup.html

은 그 때 나는 페이지와 무제한 동영상 50 수 고급 API를 시도했다. OAuth 구현을 모두 수행 할 수 있었지만 JSONP 아약스 호출을 시도 할 때 URL을 브라우저에 넣었을 때 제대로 작동하지만 나던 작업이 문제가되었습니다. :(아는 사람들을 위해

http://projects.tk-fn.com/controls/Vimeo/OAuthSimple.html

. 의 OAuth는 (전체 URL을 사용하여 만든) Consumer_Key, 비밀, NONE (임의의 문자열), 타임 스탬프, oauth_signature처럼 필요한 모든 매개 변수에 걸립니다.

나는 간단한의 OAuth의 이름으로 클래스를 발견하고 그것을 사용.

REFRESH 페이지마다 정확한 URL을 얻을 수 있습니다. URL 번 이상 사용할 수 없습니다. 메오는 모든 요청에 ​​새로운 URL을 기대합니다.

,536,
관련 문제