×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2008
    Location
    Katoomba, Australia
    Posts
    7

    App handling callback URL for OAuth

    Hi All,

    I'm trying to handle the process of OAuth 1.0 authorisation using the external web browser. I'm opening the browser with QDesktopServices::openUrl() and providing a callback URL with a custom scheme. The custom scheme is listed in my .desktop file along the lines of MimeType=x-maemo-urischeme/app-callback-scheme;, and the Exec portion is [I]Exec=/usr/bin/invoker --type=d -s /opt/arca/bin/arca %U[/] so it passes the URL into the app.

    So all this sort of works, but not in the way I want. Firstly, if I run this from Qt Creator on my N950, the app starts up, switches to the web browser, the authorisation occurs, the web browser calls the callback URL with the custom scheme and my app in invoked (with the URL in argv[1]) -- but a new instance. I don't know for sure, but I'm guessing that this is something to do with Qt Creator running it as "developer" and the web browser running it as "user".

    Anyhow, if I launch the app on the phone, we go through the above process again, but now it correctly uses the single, already running instance -- but of course I'm not receiving the URL because main() isn't being called.

    So, a few questions. Why am I getting multiple instances when running from Qt Creator? More importantly, how can I get it to use a single instance? And...

    How can I get the URL parameter when the single instance is already running?

    Best regards,

    David

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    48

    Re: App handling callback URL for OAuth

    For the first part of the question: When you launch your application from Qt Creator, it's being launched directly, not with your .desktop file. As a result, no invoker call, and no -s parameter for the first instance. The good part of this is that an end user will never experience this problem. The bad part is that in your case you will not be able to properly debug.

    For the second part, you may try to perform callback via d-bus with adaptor registered in session bus (not system bus) - this will be addressed to an already running instance of your app.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Location
    Katoomba, Australia
    Posts
    7

    Re: App handling callback URL for OAuth

    Quote Originally Posted by conxt View Post
    For the first part of the question: When you launch your application from Qt Creator, it's being launched directly, not with your .desktop file. As a result, no invoker call, and no -s parameter for the first instance. The good part of this is that an end user will never experience this problem. The bad part is that in your case you will not be able to properly debug.
    Ah ok! That would explain what I'm seeing when I execute 'ps'. Thanks.

    For the second part, you may try to perform callback via d-bus with adaptor registered in session bus (not system bus) - this will be addressed to an already running instance of your app.
    Thanks. I'll delve into d-bus and give that a go.

Similar Threads

  1. Authentication with oAuth
    By pamepros in forum Symbian
    Replies: 8
    Last Post: 2010-11-11, 10:25
  2. OAuth in Twitter
    By mastermindcoders in forum Symbian
    Replies: 16
    Last Post: 2010-09-20, 07:20
  3. Problem handling sms in callback
    By DanaB in forum Symbian
    Replies: 2
    Last Post: 2010-08-30, 18:36
  4. OAuth library
    By felixksp in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2010-06-22, 15:03

Posting Permissions

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