Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Web Login || register example

The kitchen sink dosen't have a login example is there any good examples displaying the best practices to use with titanium ?

Is their a really good forum set up for titanium yet, I have found talktitanium but not many registered user yet.

— asked September 22nd 2010 by Alan Young
  • forums
  • iphone
  • login
  • password
  • service
  • username
  • web
0 Comments

3 Answers

  • There is a login example called "Basic Auth" in the web_view.js… Well, pretty basic and non secure. The other example is "foursquare.js" using XHR for a BASE64 encoded authorization header. If you are looking for TLS Sockets: agreed, there is no example :)

    Hth: Lars

    — answered September 22nd 2010 by Lars Schwarz
    permalink
    0 Comments
  • Javascript base64_decode Example

    var postData = "salman";
    //postData += "&password=" + password;
    
    
    var xhr1 = Titanium.Network.createHTTPClient();
    xhr1.onreadystatechange=function()
    {
          user = (this.responseText);
            Ti.API.info(Ti.Utils.base64_decode(postData));
        Ti.API.info(user);
    };
    xhr1.open("POST","http://localhost:8888/get.php?key="+Ti.Utils.md5HexDigest(postData));
    xhr1.send();
    

    PHP Script to receive base64_decode

    <?php
    
    $user = $_GET['key'];
    
    $decode = base64_decode($user);
    
    echo $decode;
    
    ?>
    
    — answered September 30th 2010 by Alan Young
    permalink
    0 Comments
  • Javascript MD5 Example

    var postData = "salman";
    //postData += "&password=" + password;
    
    
    var xhr1 = Titanium.Network.createHTTPClient();
    xhr1.onreadystatechange=function()
    {
          user = (this.responseText);
            Ti.API.info(Ti.Utils.md5HexDigest(postData));
        Ti.API.info(user);
    };
    xhr1.open("POST","http://localhost:8888/get.php?key="+Ti.Utils.md5HexDigest(postData));
    xhr1.send();
    

    PHP Script to receive md5

    <?php
    $user = $_GET['key'];
    
    $key = ($user);
    
    echo $key;
    
    ?>
    
    — answered September 30th 2010 by Alan Young
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.