1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    0
    gicurmt is on a distinguished road

      0  

    Default Unanswered: Redirecting back to "localhost" for natively compiled sencha touch app

    Unanswered: Redirecting back to "localhost" for natively compiled sencha touch app


    In a nutshell... for authentication that navigates away to a site and then return via a "return_uri" parameter what do you use for natively compiled web apps? (if even possible).

    I've been using google app engine for authentication of my sencha touch app and it all works perfectly when running on localhost as well as via my online server in production. However when I compile it to a native version I am stumped at how to "redirect back" to my native app index.html when they log in.

    I have tried a custom url scheme (myapp://return etc) but it is not "redirected" back to from the remote server. I've tried having the "thankyou" page at the end include a scheme link to the native app for people to click but that quits the application. Now i'm stumbling around hoping to get an iframe solution to work, listening to the page load event (but iframes seem to be a bit dodgy).

    Google, oauth2, facebook, twitter - they all seem to require a "return to" url - so have no idea how people are doing this for sencha native apps?

    Any help would be much appreciated

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to auth without using the redirect method when you are within a native app.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    0
    gicurmt is on a distinguished road

      0  

    Default


    Cheers very much for the response. I don't however think I am able to do oauth without a url redirect (at least not with google app engine behind the scenes)

    What I ended up coming up is still using the url scheme myapp://etc but first calling Ext.device.Device.openURL to open the oauth window in safari (which I hadn't tried)... then on the final page I have a button that re-opens the native app and passes in the oauth token details. Works quite nicely now - native app just sits and waits for the device's scheme update event and takes it from there.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I'd be worried about user experience. You need a way for native apps to do this. For example, Facebook has a different way for native apps to do their auth.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    75
    Answers
    2
    Vote Rating
    1
    ShaneTex is on a distinguished road

      0  

    Default


    gicurmt,

    Do you mind sharing how you send back the auth cookie, etc via the scheme, I am trying to the the exact thing and I am stumped as to how.

    Thanks for you post.

    Shane