×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    40

    anyone familiar with Oauth version 1 & QML?

    so basically there's a reusable module for Oauth version 1 Oauth.js

    i've successfully used it in authenticated 'GET's but when using authenticated POST with additional parameters.. it always returns invalid signature from the server.
    Last edited by loellanthony; 2011-06-02 at 11:48.

  2. #2
    Registered User
    Join Date
    Jul 2010
    Posts
    40

    Re: anyone familiar with Oauth version 1 & QML?

    anybody? surely these are the type of must haves in mobile apps.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Location
    Kosice
    Posts
    4

    Re: anyone familiar with Oauth version 1 & QML?

    Hi, I am familiar with. What do you need?

  4. #4
    Registered User
    Join Date
    Jul 2010
    Posts
    40

    Re: anyone familiar with Oauth version 1 & QML?

    my problem is My authenticated POST always returns an invalid signature.
    using the linked Oauth module below, i made a request something like this,

    req.getOAuthRequest("POST","http://beta-api.formspring.me/inbox/respond/"+ id +".xml",null,{"token":"my_access_token","secret":"my_access_secret"},{'response': "some random string with spaces"})

    but then it returns an invalid signature, i even tried a string with no spaces as the "response" parameter, yet still the same error.

  5. #5
    Registered User
    Join Date
    Jul 2010
    Location
    Kosice
    Posts
    4

    Re: anyone familiar with Oauth version 1 & QML?

    can you describe more deeply please ?

  6. #6
    Registered User
    Join Date
    Jul 2010
    Posts
    40

    Re: anyone familiar with Oauth version 1 & QML?

    so i'm using formspring API, it's a Q & A service?
    http://dev.formspring.me/api-methods
    basically i have already got the secret token and secret access, and i could request the APIs endpoints that only requires GET, and the server returns the successful responses ei. get your profile, read your inbox and such.

    but when i try to respond to a question using this endpoint
    http://dev.formspring.me/api-methods/inbox-respond

    which is already shown at the snippet below which like i said is a POST request, the server will spit an invalid signature.

    btw, are you human? your response is kinda typical and botlike i hope to god that you really are, as i have been into this problem for weeks now.
    thnx..

  7. #7
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Re: anyone familiar with Oauth version 1 & QML?

    Regards
    Viral Parmar

  8. #8
    Registered User
    Join Date
    Jul 2010
    Posts
    40

    Re: anyone familiar with Oauth version 1 & QML?

    I believe that wiki was about, how to acquire tokens? plus i think their referring to OAuth version 2?

    this specific problem though, is with Oauth version 1 , I've already got my access tokens and secret access (key)
    not really an authentication problem, rather an authenticated request problem regarding 'POST' requests.

  9. #9
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Re: anyone familiar with Oauth version 1 & QML?

    Quote Originally Posted by loellanthony View Post
    my problem is My authenticated POST always returns an invalid signature.
    using the linked Oauth module below, i made a request something like this,

    req.getOAuthRequest("POST","http://beta-api.formspring.me/inbox/respond/"+ id +".xml",null,{"token":"my_access_token","secret":"my_access_secret"},{'response': "some random string with spaces"})

    but then it returns an invalid signature, i even tried a string with no spaces as the "response" parameter, yet still the same error.
    hi loellanthony,
    I have gone through whole issue and still m unable to figure out the problem, but then also i came to a conclusion with changing the protocol https instead of http.
    well try with this,further will let you knw in case i come across any issue...
    Regards
    Viral Parmar

  10. #10
    Registered User
    Join Date
    Jul 2010
    Location
    Kosice
    Posts
    4

    Re: anyone familiar with Oauth version 1 & QML?

    I think, that you forgot sign request. Try follow this steps (javascript code)
    1. var params = {
    "login" : superuser
    }
    2. create method signUrl

    function signURL(method, url, params) {
    var accessor = {
    token: oauth_token,
    tokenSecret: oauth_token_secret,
    consumerKey: consumer_key,
    consumerSecret: api_secret
    };

    var message = {
    action: url,
    method: method,
    parameters: params
    };

    OAuth.completeRequest(message, accessor);
    url = url + '?' + OAuth.formEncode(message.parameters);
    return url;
    }
    methods: OAuth.completeRequest and OAuth.formEncode are comming from oauth.js

    3. set valid url http://.....
    4. call function signUrl("POST", requestUrl, params);

    I hope it will help

  11. #11
    Registered User
    Join Date
    Jul 2010
    Location
    Kosice
    Posts
    4

    Re: anyone familiar with Oauth version 1 & QML?

    try following and use method from previous reply:
    First change singURL method to look as follows:
    function signURL(method, url, params) {
    var accessor = {
    token: my_access_token,
    tokenSecret: my_access_secret
    };

    var message = {
    action: url,
    method: method,
    parameters: params
    };

    OAuth.completeRequest(message, accessor);
    url = url + '?' + OAuth.formEncode(message.parameters);
    return url;
    }
    1. var params = {
    "response" : "test"
    }
    2. var url = "http://beta-api.formspring.me/inbox/respond/"+ id; ID HAS TO BE SET CORRECTLY
    3. signUrl("POST", requestUrl, params);

    req.getOAuthRequest("POST","http://beta-api.formspring.me/inbox/respond/"+ id +".xml",null,{"token":"my_access_token","secret":"my_access_secret"},{'response': "some random string with spaces"})

Similar Threads

  1. Authentication with oAuth
    By pamepros in forum Symbian
    Replies: 8
    Last Post: 2010-11-11, 10:25
  2. Some small question to get familiar with my IDE
    By deepakk in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-07-28, 15:22
  3. Replies: 1
    Last Post: 2006-03-20, 06:21
  4. D211 on IPAQ 3660 with familiar linux
    By itxs in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×