1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Vancouver, WA
    Posts
    5
    Vote Rating
    0
    ashworthconsulting is on a distinguished road

      0  

    Question Unanswered: API Authentication with Sencha Ext JS or Sencha Touch

    Unanswered: API Authentication with Sencha Ext JS or Sencha Touch


    I'm sure it's probably simple that I'm overlooking (usually is), but I'm banging my head against the wall with this simple authentication issue. I think it's more about how I'm constructing my AJAX calls than anything else.

    Code:
    Ext.define('MyApp.store.base.MyJsonStore', {
        extend: 'Ext.data.Store',
    
        config: {
            storeId: 'MyJsonStore',
            proxy: {
                type: 'ajax',
                url: 'http://mywebsite.com:2086/json-api/listaccts',
                method: 'GET',
                username: 'cpanelusergoeshere',
                password: 'h2liku3h4lkquyweilkruyahwukey',
                reader: {
                    type: 'json'
                }
            }
        }
    });
    The error message I keep seeing from the console I'm using is:

    Unable to load data using the supplied configuration.
    Open in Browser http://mywebsite.com:2086/json-api/listaccts
    Any ideas? Totally lost on this one.

  2. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,114
    Answers
    83
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    These properties don't exists

    Code:
    username: 'cpanelusergoeshere',
                password: 'h2liku3h4lkquyweilkruyahwukey',
    in the proxy.

    Better you log in to your domain first and then launch yout app.

  3. #3
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    If you're just trying to perform an authentication attempt, do a standard Ajax request:

    Code:
    Ext.Ajax.request({
      url: 'http://mywebsite.com:2086/json-api/listaccts',
      params: {
        username: 'cpanelusergoeshere',
        password: 'h2liku3h4lkquyweilkruyahwukey'  
      },
      success: function(response, opts) {
        // decode String response into JSON.
        var obj = Ext.decode(response.responseText);
        // examine response object, then load/create some content.
      },
      failure: function(response, opts) {
        console.log('server-side failure with status code ' + response.status);
      }
    });
    Last edited by friend; 7 Feb 2012 at 4:49 AM. Reason: comments

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi