1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Answers
    1
    Vote Rating
    1
    Tequiol is on a distinguished road

      0  

    Default Unanswered: How can I prevent the 401 Authentication dialog for Ajax requests with invalid creds?

    Unanswered: How can I prevent the 401 Authentication dialog for Ajax requests with invalid creds?


    Hello,

    I've an application that authenticates via HTTP (as described in my previous post). I've a problem when the user enters invalid authorization data, the client calls the function to get the settings on the server. If this function success without errors, the user is logged in. But if the authentication fails, the server throws a 401 missing authorization error. The browser will handle this error. So the default authorization dialog pops up. Can I prevent this default authorization dialog?

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Answers
    1
    Vote Rating
    1
    Tequiol is on a distinguished road

      0  

    Default


    Does really nobody know the answer?

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2007
    Location
    Ostrava, Czech Republic
    Posts
    43
    Vote Rating
    2
    ostghost is on a distinguished road

      0  

    Default 401 handler in AJAX call

    401 handler in AJAX call


    Hi,

    try to handle exceptions. I use following construction in Sencha Touch. In Ext JS 3 I used similar codein combination with plugin to stock call and recall them after succesful login
    PHP Code:
    Ext.Ajax.on('requestexception', function (connresponseoptions) {

                switch (
    response.status) {
                    case 
    :
                        
    Ext.Msg.alert(Loading error!', 'No connection.');
                        break;
                    case 401 :
                        Ext.Msg.alert('
    Authentication failed!', 'Fill your credentials.');
                        break;
                    default :
                        Ext.Msg.alert('
    Uups!', 'Error.');
                }
            }); 
    Btw. There could be problem with options.records length when loading store and receiving 401.

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Answers
    1
    Vote Rating
    1
    Tequiol is on a distinguished road

      0  

    Default


    Hello,

    yes this error handling works after the browser authentication dialog is shown. The script execution is stopped until the user clicks "Cancel" in this dialog. After that the error handler will be executed. I'm looking for a solution that prevents the authentication dialog of the browser.

  5. #5
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    1
    rfender is on a distinguished road

      0  

    Default


    Quote Originally Posted by Tequiol View Post
    Hello,

    yes this error handling works after the browser authentication dialog is shown. The script execution is stopped until the user clicks "Cancel" in this dialog. After that the error handler will be executed. I'm looking for a solution that prevents the authentication dialog of the browser.
    Tequiol, did you find a solution to this?

  6. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Answers
    1
    Vote Rating
    1
    Tequiol is on a distinguished road

      0  

    Default


    No, I never found a solution for this.

  7. #7
    Sencha User
    Join Date
    Sep 2011
    Posts
    568
    Answers
    58
    Vote Rating
    69
    ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice

      0  

    Default


    Can't your server return just 403 for AJAX requests instead of 401?
    Then you will be able to perform proper error handling.

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